mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
Shell: Use _exit() in the forked child if execvp() fails
If we can't find an executable to exec() after forking, we don't want to run the atexit() handlers in the child process. Just use _exit() instead to avoid this. This was causing us to write out the shell history to ~/.history every time a "command not found" error was printed.
This commit is contained in:
parent
c399abe3e2
commit
cd55f76727
1 changed files with 1 additions and 1 deletions
|
@ -754,7 +754,7 @@ static int run_command(const String& cmd)
|
|||
fprintf(stderr, "%s: Command not found.\n", argv[0]);
|
||||
else
|
||||
fprintf(stderr, "execvp(%s): %s\n", argv[0], strerror(errno));
|
||||
exit(1);
|
||||
_exit(1);
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue