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

@@ -99,7 +99,7 @@ static int fork_cmnd(struct command_details *details, int sv[2])
sa.sa_handler = handler;
sigaction(SIGCONT, &sa, NULL);
child = fork();
child = sudo_debug_fork();
switch (child) {
case -1:
error(1, _("unable to fork"));
@@ -214,7 +214,7 @@ sudo_execute(struct command_details *details, struct command_status *cstat)
/* If running in background mode, fork and exit. */
if (ISSET(details->flags, CD_BACKGROUND)) {
switch (fork()) {
switch (sudo_debug_fork()) {
case -1:
cstat->type = CMD_ERRNO;
cstat->val = errno;