2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Log the process id in the debug file output. Since we don't want

to keep calling getpid(), stash the value at init time and when we
fork().
This commit is contained in:
Todd C. Miller
2012-04-06 15:20:16 -04:00
parent bb898cd5df
commit c8ce3a0a85
6 changed files with 31 additions and 10 deletions

View File

@@ -441,7 +441,7 @@ send_mail(const char *fmt, ...)
debug_return;
/* Fork and return, child will daemonize. */
switch (pid = fork()) {
switch (pid = sudo_debug_fork()) {
case -1:
/* Error. */
error(1, _("unable to fork"));
@@ -510,7 +510,7 @@ send_mail(const char *fmt, ...)
_exit(1);
}
switch (pid = fork()) {
switch (pid = sudo_debug_fork()) {
case -1:
/* Error. */
mysyslog(LOG_ERR, _("unable to fork: %m"));