diff --git a/src/flog.h b/src/flog.h index 111f0476e..cba1d4aac 100644 --- a/src/flog.h +++ b/src/flog.h @@ -74,6 +74,7 @@ class category_list_t { L"Reaping internal (non-forked) processes"}; category_t proc_reap_external{L"proc-reap-external", L"Reaping external (forked) processes"}; + category_t proc_pgroup{L"proc-pgroup", L"Process groups"}; category_t env_locale{L"env-locale", L"Changes to locale variables"}; diff --git a/src/postfork.cpp b/src/postfork.cpp index c3e0a77b2..4dfad691f 100644 --- a/src/postfork.cpp +++ b/src/postfork.cpp @@ -124,7 +124,7 @@ bool set_child_group(job_t *j, pid_t child_pid) { // ever leads to a terminal hang due if both this setpgid call AND posix_spawn's // internal setpgid calls failed), write to the debug log so a future developer // doesn't go crazy trying to track this down. - debug(2, "Error %d while calling setpgid for child %d (probably harmless)", errno, + FLOGF(proc_pgroup, "Error %d while calling setpgid for child %d (probably harmless)", errno, child_pid); } } diff --git a/src/proc.cpp b/src/proc.cpp index 03ce28c47..324ea3fa4 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -798,7 +798,7 @@ pid_t terminal_acquire_before_builtin(int job_pgid) { static bool terminal_return_from_job(job_t *j, int restore_attrs) { errno = 0; if (j->pgid == 0) { - debug(2, "terminal_return_from_job() returning early due to no process group"); + FLOG(proc_pgroup, "terminal_return_from_job() returning early due to no process group"); return true; } @@ -868,7 +868,7 @@ void job_t::continue_job(parser_t &parser, bool reclaim_foreground_pgrp, bool se // signal individually. job_t::signal() does the same, but uses the shell's own pgroup // to make that distinction. if (!signal(SIGCONT)) { - debug(2, "Failed to send SIGCONT to any processes in pgroup %d!", pgid); + FLOGF(proc_pgroup, "Failed to send SIGCONT to any processes in pgroup %d!", pgid); // This returns without bubbling up the error. Presumably that is OK. return; }