]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chsh: fix gcc link() warn_unused_result warning
authorKarel Zak <kzak@redhat.com>
Thu, 17 Feb 2011 11:00:36 +0000 (12:00 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 18 Apr 2011 12:30:08 +0000 (14:30 +0200)
setpwnam.c:176:9: warning: ignoring return value of ‘link’, declared with attribute warn_unused_result

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

index 05ce147b4b598f7f1b8418b31cd7db77efe85462..c1e6efb17b1d057897057ee722f1434a0993fbeb 100644 (file)
@@ -63,6 +63,7 @@
 #include <paths.h>
 
 #include "setpwnam.h"
+#include "c.h"
 
 #define false 0
 #define true 1
@@ -177,7 +178,7 @@ setpwnam (struct passwd *pwd)
     /* we don't care if we can't remove the backup file */
     unlink(PASSWD_FILE".OLD");
     /* we don't care if we can't create the backup file */
-    link(PASSWD_FILE, PASSWD_FILE".OLD");
+    ignore_result( link(PASSWD_FILE, PASSWD_FILE".OLD") );
     /* we DO care if we can't rename to the passwd file */
     if(rename(PTMP_FILE, PASSWD_FILE) < 0)
        goto fail;