mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 01:17:45 +00:00
Stop retrying close() on EINTR
https://lwn.net/Articles/576478/ http://austingroupbugs.net/view.php?id=529 https://sourceware.org/bugzilla/show_bug.cgi?id=14627
This commit is contained in:
parent
06e5194092
commit
ca61fc1bf8
2 changed files with 5 additions and 10 deletions
|
@ -2010,11 +2010,8 @@ void convert_wide_array_to_narrow(const null_terminated_array_t<wchar_t> &wide_a
|
|||
|
||||
void autoclose_fd_t::close() {
|
||||
if (fd_ < 0) return;
|
||||
while (::close(fd_) == -1) {
|
||||
if (errno != EINTR) {
|
||||
wperror(L"close");
|
||||
break;
|
||||
}
|
||||
if (::close(fd_) == -1) {
|
||||
wperror(L"close");
|
||||
}
|
||||
fd_ = -1;
|
||||
}
|
||||
|
|
|
@ -73,11 +73,9 @@ void exec_close(int fd) {
|
|||
}
|
||||
|
||||
while (close(fd) == -1) {
|
||||
if (errno != EINTR) {
|
||||
debug(1, FD_ERROR, fd);
|
||||
wperror(L"close");
|
||||
break;
|
||||
}
|
||||
debug(1, FD_ERROR, fd);
|
||||
wperror(L"close");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue