Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(953)

Unified Diff: runtime/bin/fdutils_android.cc

Issue 2495003003: Adds some error handling to the socket implementation. (Closed)
Patch Set: Add perror calls for fcntl Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/eventhandler_macos.cc ('k') | runtime/bin/fdutils_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/fdutils_android.cc
diff --git a/runtime/bin/fdutils_android.cc b/runtime/bin/fdutils_android.cc
index e61a2e151c6082772a506da30a15f24c694ece6b..5d8a8e004c301b150914899ff580c167d7c7a701 100644
--- a/runtime/bin/fdutils_android.cc
+++ b/runtime/bin/fdutils_android.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;
« no previous file with comments | « runtime/bin/eventhandler_macos.cc ('k') | runtime/bin/fdutils_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698