* lib/exitcodes.h: Define E_SUCCESS as EXIT_SUCCESS. Added FIXMEs.
* libmisc/chowntty.c, libmisc/rlogin.c, libmisc/sub.c, src/newusers.c, libmisc/sulog.c, libmisc/system.c, src/logoutd.c, src/groups.c, src/id.c, lib/encrypt.c, libmisc/audit_help.c, libmisc/limits.c: Return EXIT_FAILURE instead of 1, and EXIT_SUCCESS instead of 0. * libmisc/audit_help.c: Replace an fprintf() by fputs(). * libmisc/audit_help.c: Remove documentation of the audit_logger returned values. The function returns void. * libmisc/system.c: Only return status if waitpid succeeded. Return -1 otherwise.
This commit is contained in:
@@ -51,8 +51,11 @@ int safe_system (const char *command,
|
||||
}
|
||||
|
||||
if (pid) { /* Parent */
|
||||
waitpid (pid, &status, 0);
|
||||
return status;
|
||||
if (waitpid (pid, &status, 0) > 0) {
|
||||
return status;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
fd = open ("/dev/null", O_RDWR);
|
||||
@@ -64,6 +67,6 @@ int safe_system (const char *command,
|
||||
|
||||
execve (command, (char *const *) argv, (char *const *) env);
|
||||
fprintf (stderr, _("Failed to exec '%s'\n"), argv[0]);
|
||||
exit (-1);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user