mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +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
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…
Add table
Add a link
Reference in a new issue