Index: runtime/bin/fdutils_linux.cc |
diff --git a/runtime/bin/fdutils_linux.cc b/runtime/bin/fdutils_linux.cc |
index a76fcdbad5aced0372a3c6e54c846878a7bc4072..5a174ee151ca4dbb33754f7c98faabc96c4f91aa 100644 |
--- a/runtime/bin/fdutils_linux.cc |
+++ b/runtime/bin/fdutils_linux.cc |
@@ -21,10 +21,12 @@ bool FDUtils::SetCloseOnExec(intptr_t fd) { |
intptr_t status; |
status = NO_RETRY_EXPECTED(fcntl(fd, F_GETFD)); |
if (status < 0) { |
+ perror("fcntl(F_GETFD) failed"); |
return false; |
} |
status |= FD_CLOEXEC; |
if (NO_RETRY_EXPECTED(fcntl(fd, F_SETFD, status)) < 0) { |
+ perror("fcntl(F_SETFD, FD_CLOEXEC) failed"); |
return false; |
} |
return true; |
@@ -35,10 +37,12 @@ static bool SetBlockingHelper(intptr_t fd, bool blocking) { |
intptr_t status; |
status = NO_RETRY_EXPECTED(fcntl(fd, F_GETFL)); |
if (status < 0) { |
+ perror("fcntl(F_GETFL) failed"); |
return false; |
} |
status = blocking ? (status & ~O_NONBLOCK) : (status | O_NONBLOCK); |
if (NO_RETRY_EXPECTED(fcntl(fd, F_SETFL, status)) < 0) { |
+ perror("fcntl(F_SETFL, O_NONBLOCK) failed"); |
return false; |
} |
return true; |