public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] login-utils: use libc error printing facility
@ 2014-12-07 10:13 Sami Kerola
  2014-12-07 10:13 ` [PATCH 2/3] textual: improve error messages Sami Kerola
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sami Kerola @ 2014-12-07 10:13 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 login-utils/islocal.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/login-utils/islocal.c b/login-utils/islocal.c
index 13ce28e..7c4e775 100644
--- a/login-utils/islocal.c
+++ b/login-utils/islocal.c
@@ -82,13 +82,10 @@ static int is_local_in_file(const char *user, const char *filename)
 int is_local(const char *user)
 {
 	int rv;
-	if ((rv = is_local_in_file(user, _PATH_PASSWD)) < 0) {
-		perror(_PATH_PASSWD);
-		fprintf(stderr, _("cannot open %s"), _PATH_PASSWD);
-		exit(1);
-	} else {
-		return rv;
-	}
+
+	if ((rv = is_local_in_file(user, _PATH_PASSWD)) < 0)
+		err(EXIT_FAILURE, _("cannot open %s"), _PATH_PASSWD);
+	return rv;
 }
 
 #ifdef TEST_PROGRAM
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-09  8:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-07 10:13 [PATCH 1/3] login-utils: use libc error printing facility Sami Kerola
2014-12-07 10:13 ` [PATCH 2/3] textual: improve error messages Sami Kerola
2014-12-07 10:13 ` [PATCH 3/3] line: use util-linux conventions Sami Kerola
2014-12-09  8:22 ` [PATCH 1/3] login-utils: use libc error printing facility Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox