diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-06-16 21:25:33 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-06-16 21:25:33 -0700 |
commit | 34fd8e0e00a701f399b61e069c601c59e31b10e9 (patch) | |
tree | c623665c7c5e22bb7bc81e934b623081e6d9af71 /common.cpp | |
parent | 6cf42075fcbf4cb75fa00197f227b8a5eceae2bd (diff) |
Tweak fork guards to be more forgiving
Diffstat (limited to 'common.cpp')
-rw-r--r-- | common.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1943,9 +1943,12 @@ void configure_thread_assertions_for_testing(void) { } /* Notice when we've forked */ -static pid_t initial_pid; +static pid_t initial_pid = 0; bool is_forked_child(void) { + /* Just bail if nobody's called setup_fork_guards - e.g. fishd */ + if (! initial_pid) return false; + bool is_child_of_fork = (getpid() != initial_pid); if (is_child_of_fork) { printf("Uh-oh: %d\n", getpid()); |