]> err.no Git - util-linux/commitdiff
vipw: fix warn_unused_result gcc warning
authorKarel Zak <kzak@redhat.com>
Fri, 10 Dec 2010 16:07:44 +0000 (17:07 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 10 Dec 2010 16:07:44 +0000 (17:07 +0100)
vipw.c:194:6: warning: ignoring return value of ‘link’, declared with
attribute warn_unused_result

Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/vipw.c

index 64d40c99b13dd6a8c194563b51db82f1409b0ed3..5750e6f92d6af4859126629310169562d04e3365 100644 (file)
@@ -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) {