From 35f0a2e95195920f6a14731c365b6e4f43370eb4 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Thu, 23 Apr 2009 11:14:18 +0000 Subject: [PATCH] * libmisc/age.c: Use exit(EXIT_FAILURE) instead of exit(1). * libmisc/age.c: The return value of execl() is not used. --- ChangeLog | 5 +++++ libmisc/age.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 442b578c..183b8052 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-22 Nicolas François + + * libmisc/age.c: Use exit(EXIT_FAILURE) instead of exit(1). + * libmisc/age.c: The return value of execl() is not used. + 2009-04-22 Nicolas François * libmisc/xgetXXbyYY.c, libmisc/myname.c, libmisc/getgr_nam_gid.c, diff --git a/libmisc/age.c b/libmisc/age.c index 7b28d14a..d46abdc3 100644 --- a/libmisc/age.c +++ b/libmisc/age.c @@ -92,7 +92,7 @@ int expire (const struct passwd *pw, const struct spwd *sp) if ((status > 1) || (sp->sp_max < sp->sp_min)) { (void) puts (_(" Contact the system administrator.")); - exit (1); + exit (EXIT_FAILURE); } (void) puts (_(" Choose a new password.")); (void) fflush (stdout); @@ -135,13 +135,13 @@ int expire (const struct passwd *pw, const struct spwd *sp) _exit (126); } - execl (PASSWD_PROGRAM, PASSWD_PROGRAM, pw->pw_name, (char *) 0); + (void) execl (PASSWD_PROGRAM, PASSWD_PROGRAM, pw->pw_name, (char *) 0); err = errno; perror ("Can't execute " PASSWD_PROGRAM); _exit ((ENOENT == err) ? E_CMD_NOTFOUND : E_CMD_NOEXEC); } else if ((pid_t) -1 == pid) { perror ("fork"); - exit (1); + exit (EXIT_FAILURE); } while (((child = wait (&status)) != pid) && (child != (pid_t)-1)); @@ -150,8 +150,8 @@ int expire (const struct passwd *pw, const struct spwd *sp) return 1; } - exit (1); - /*NOTREACHED*/} + exit (EXIT_FAILURE); + /*@notreached@*/} /* * agecheck - see if warning is needed for password expiration