diff --git a/src/common.cpp b/src/common.cpp index 334fd6011..df3b68359 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -2010,11 +2010,8 @@ void convert_wide_array_to_narrow(const null_terminated_array_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; } diff --git a/src/exec.cpp b/src/exec.cpp index 672331221..957c7fbb1 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -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; } }