Shell: Correct program stop behaviour
Prior to this, we would only wait for program exit; the shell should stop waiting once the program has been stopped. Fixes #2230
This commit is contained in:
parent
c6ddbd1f3e
commit
6fcdfe1169
Notes:
sideshowbarker
2024-07-19 06:38:04 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/6fcdfe11697 Pull-request: https://github.com/SerenityOS/serenity/pull/2235 Issue: https://github.com/SerenityOS/serenity/issues/2230
1 changed files with 2 additions and 2 deletions
|
@ -655,7 +655,7 @@ static bool handle_builtin(int argc, const char** argv, int& retval)
|
|||
|
||||
class FileDescriptionCollector {
|
||||
public:
|
||||
FileDescriptionCollector() {}
|
||||
FileDescriptionCollector() { }
|
||||
~FileDescriptionCollector() { collect(); }
|
||||
|
||||
void collect()
|
||||
|
@ -1075,7 +1075,7 @@ static ExitCodeOrContinuationRequest run_command(const StringView& cmd)
|
|||
for (size_t i = 0; i < children.size(); ++i) {
|
||||
auto& child = children[i];
|
||||
do {
|
||||
int rc = waitpid(child.pid, &wstatus, 0);
|
||||
int rc = waitpid(child.pid, &wstatus, WSTOPPED);
|
||||
if (rc < 0 && errno != EINTR) {
|
||||
if (errno != ECHILD)
|
||||
perror("waitpid");
|
||||
|
|
Loading…
Add table
Reference in a new issue