fix fork debug printf() calls

The fork (create new process) related debugging messages rely on an
undocumented env var and use `printf()` rather than `debug()`. There are
also errors in how the fork count is tracked that this fixes.

Fixes #2995
This commit is contained in:
Kurtis Rader
2016-05-05 20:05:45 -07:00
parent 4481692037
commit bc6cc4c105
4 changed files with 25 additions and 52 deletions

View File

@@ -440,8 +440,6 @@ int main(int argc, char **argv) {
parser_t &parser = parser_t::principal_parser();
if (g_log_forks) printf("%d: g_fork_count: %d\n", __LINE__, g_fork_count);
const io_chain_t empty_ios;
if (read_init(paths)) {
// Stomp the exit status of any initialization commands (issue #635).
@@ -515,9 +513,6 @@ int main(int argc, char **argv) {
builtin_destroy();
reader_destroy();
event_destroy();
if (g_log_forks) printf("%d: g_fork_count: %d\n", __LINE__, g_fork_count);
exit_without_destructors(exit_status);
return EXIT_FAILURE; // above line should always exit
}