mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
nohup: Don't leak fd used to open nohup.out
Since we may redirect stdout, stderr, or both to the file description referring to the nohup.out file, there is no need to keep the fd that created that file description around.
This commit is contained in:
parent
7da055e3e1
commit
590f0f85e0
Notes:
sideshowbarker
2024-07-17 04:03:27 +09:00
Author: https://github.com/kemzeb Commit: https://github.com/SerenityOS/serenity/commit/590f0f85e0 Pull-request: https://github.com/SerenityOS/serenity/pull/20107 Reviewed-by: https://github.com/bugaevc ✅
1 changed files with 2 additions and 0 deletions
|
@ -44,6 +44,8 @@ void dup_out_file(int fd_to_redirect)
|
|||
exit(127);
|
||||
}
|
||||
|
||||
MUST(Core::System::close(fd));
|
||||
|
||||
if (fd_to_redirect != STDERR_FILENO)
|
||||
outln(stderr, "appending output to {}", path);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue