mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 01:11:15 -03:00
Tweak fork guards to be more forgiving
Fixes https://github.com/fish-shell/fish-shell/issues/101
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user