mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 07:47:09 +08:00
Remove some nonsense in exec_close
exec_close should assert that the fd is valid, then loop while EINTR. Nothing else is needed.
This commit is contained in:
parent
86897cafd6
commit
d29bc720cd
@ -56,14 +56,7 @@
|
||||
static relaxed_atomic_t<int> s_fork_count{0};
|
||||
|
||||
void exec_close(int fd) {
|
||||
ASSERT_IS_MAIN_THREAD();
|
||||
|
||||
// This may be called in a child of fork(), so don't allocate memory.
|
||||
if (fd < 0) {
|
||||
FLOG(error, L"Called close on invalid file descriptor ");
|
||||
return;
|
||||
}
|
||||
|
||||
assert(fd >= 0 && "Invalid fd");
|
||||
while (close(fd) == -1) {
|
||||
if (errno != EINTR) {
|
||||
debug(1, FD_ERROR, fd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user