* src/newgrp.c, src/chfn.c, src/groupmems.c, src/usermod.c,
src/userdel.c, src/chpasswd.c, src/grpck.c, src/gpasswd.c, src/groupdel.c, src/chgpasswd.c, src/vipw.c, src/useradd.c, src/su.c, src/groupmod.c, src/passwd.c, src/pwck.c, src/groupadd.c, src/chage.c, src/login.c, src/faillog.c, src/sulogin.c, src/chsh.c, src/pwconv.c: Added splint annotations. * src/userdel.c, src/pwconv.c, src/lastlog.c, src/grpck.c, src/vipw.c, src/groupmod.c, src/passwd.c, src/pwck.c, src/login.c, src/sulogin.c, src/usermod.c: Use return instead of exit at the end of main(). * src/gpasswd.c, src/passwd.c, src/faillog.c: Use the exitcodes.h exit codes. * src/chpasswd.c: Added missing ||. * src/nologin.c: Do not include exitcodes.h. * src/nologin.c: Added brackets. * src/nologin.c: Avoid assignments in comparisons.
This commit is contained in:
@@ -42,7 +42,9 @@
|
||||
#include "defines.h"
|
||||
#include "getdef.h"
|
||||
#include "prototypes.h"
|
||||
/*@-exitarg@*/
|
||||
#include "exitcodes.h"
|
||||
|
||||
/*
|
||||
* Global variables
|
||||
*/
|
||||
@@ -345,7 +347,7 @@ static void syslog_sg (const char *name, const char *group)
|
||||
(unsigned long) gid, name));
|
||||
}
|
||||
closelog ();
|
||||
exit (EXIT_SUCCESS);
|
||||
exit (E_SUCCESS);
|
||||
}
|
||||
|
||||
/* child - restore signals to their default state */
|
||||
@@ -728,7 +730,7 @@ int main (int argc, char **argv)
|
||||
(unsigned int) getuid (), 0);
|
||||
#endif
|
||||
perror ("/bin/sh");
|
||||
exit (errno == ENOENT ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
|
||||
exit ((errno == ENOENT) ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -800,7 +802,7 @@ int main (int argc, char **argv)
|
||||
* the previous environment which should be the user's login shell.
|
||||
*/
|
||||
err = shell (prog, initflag ? (char *) 0 : cp, newenvp);
|
||||
exit (err == ENOENT ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
|
||||
exit ((err == ENOENT) ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
|
||||
/* @notreached@ */
|
||||
failure:
|
||||
|
||||
|
Reference in New Issue
Block a user