diff --git a/Shell/Parser.cpp b/Shell/Parser.cpp index 6252f5e232a..464f5ff4653 100644 --- a/Shell/Parser.cpp +++ b/Shell/Parser.cpp @@ -228,10 +228,9 @@ RefPtr Parser::parse_sequence() return first; } case '&': { - auto execute_pipe_seq = first->would_execute() ? first.release_nonnull() : static_cast>(create(first.release_nonnull())); consume(); auto pos_after_seps = save_offset(); - auto bg = create(execute_pipe_seq); // Execute Background + auto bg = create(first.release_nonnull()); // Execute Background if (auto rest = parse_sequence()) return create( move(bg), diff --git a/Shell/Shell.cpp b/Shell/Shell.cpp index 6ab017e962f..7d73eece360 100644 --- a/Shell/Shell.cpp +++ b/Shell/Shell.cpp @@ -1443,7 +1443,16 @@ void Shell::notify_child_event() } found_child = true; #ifdef ENSURE_WAITID_ONCE - s_waited_for_pids.set(child_pid); + // NOTE: This check is here to find bugs about our assumptions about waitpid(), + // it does not hold in general, and it definitely does not hold in the long run. + // Reasons that we would call waitpid() more than once: + // - PID reuse/wraparound: This will simply fail the assertion, ignored here. + // - Non-terminating unblocks: + // - Suspension: (e.g. via ^Z) + // - ? + // - ? + if (job.exited()) + s_waited_for_pids.set(child_pid); #endif } if (job.should_be_disowned())