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

Unified Diff: runtime/bin/eventhandler_linux.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_android.cc ('k') | runtime/bin/eventhandler_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_linux.cc
diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
index fd410fece963efeb0dbf82db849ec03da3ea1299..8b35818ccd680ccf936c8ab4561e0bf569db23ac 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -80,9 +80,15 @@ EventHandlerImplementation::EventHandlerImplementation()
if (result != 0) {
FATAL("Pipe creation failed");
}
- FDUtils::SetNonBlocking(interrupt_fds_[0]);
- FDUtils::SetCloseOnExec(interrupt_fds_[0]);
- FDUtils::SetCloseOnExec(interrupt_fds_[1]);
+ if (!FDUtils::SetNonBlocking(interrupt_fds_[0])) {
+ FATAL("Failed to set pipe fd non blocking\n");
+ }
+ if (!FDUtils::SetCloseOnExec(interrupt_fds_[0])) {
+ FATAL("Failed to set pipe fd close on exec\n");
+ }
+ if (!FDUtils::SetCloseOnExec(interrupt_fds_[1])) {
+ FATAL("Failed to set pipe fd close on exec\n");
+ }
shutdown_ = false;
// The initial size passed to epoll_create is ignore on newer (>=
// 2.6.8) Linux versions
@@ -91,7 +97,9 @@ EventHandlerImplementation::EventHandlerImplementation()
if (epoll_fd_ == -1) {
FATAL1("Failed creating epoll file descriptor: %i", errno);
}
- FDUtils::SetCloseOnExec(epoll_fd_);
+ if (!FDUtils::SetCloseOnExec(epoll_fd_)) {
+ FATAL("Failed to set epoll fd close on exec\n");
+ }
// Register the interrupt_fd with the epoll instance.
struct epoll_event event;
event.events = EPOLLIN;
« no previous file with comments | « runtime/bin/eventhandler_android.cc ('k') | runtime/bin/eventhandler_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698