From 18be404b29204db395ccb3c5bf7971b49ccdfa98 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 10 Dec 2010 17:07:44 +0100 Subject: [PATCH] vipw: fix warn_unused_result gcc warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit vipw.c:194:6: warning: ignoring return value of ‘link’, declared with attribute warn_unused_result Signed-off-by: Karel Zak --- login-utils/vipw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.39.5