From: Karel Zak Date: Fri, 10 Dec 2010 16:07:44 +0000 (+0100) Subject: vipw: fix warn_unused_result gcc warning X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18be404b29204db395ccb3c5bf7971b49ccdfa98;p=util-linux vipw: fix warn_unused_result gcc warning vipw.c:194:6: warning: ignoring return value of ‘link’, declared with attribute warn_unused_result Signed-off-by: Karel Zak --- diff --git a/login-utils/vipw.c b/login-utils/vipw.c index 64d40c99..5750e6f9 100644 --- a/login-utils/vipw.c +++ b/login-utils/vipw.c @@ -191,7 +191,9 @@ pw_unlock(void) { sprintf(tmp, "%s%s", orig_file, ".OLD"); unlink(tmp); - link(orig_file, tmp); + + if (link(orig_file, tmp)) + warn(_("%s: create a link to %s failed"), orig_file, tmp); #ifdef HAVE_LIBSELINUX if (is_selinux_enabled() > 0) {