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

Unified Diff: base/debug_util_posix.cc

Issue 100225: POSIX: Add a macro for handling EINTR. (Closed)
Patch Set: ... Created 11 years, 8 months 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 | « no previous file | base/directory_watcher_inotify.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug_util_posix.cc
diff --git a/base/debug_util_posix.cc b/base/debug_util_posix.cc
index ced59c82e3e9ad8fa9bee17db3116cf07ff41b65..f10c38ef40bf91ea04a3087e950a5776bef63fbb 100644
--- a/base/debug_util_posix.cc
+++ b/base/debug_util_posix.cc
@@ -15,6 +15,7 @@
#include <unistd.h>
#include "base/basictypes.h"
+#include "base/eintr_wrappers.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
#include "base/string_piece.h"
@@ -85,8 +86,8 @@ bool DebugUtil::BeingDebugged() {
// This simplifies and speeds up things considerably.
char buf[1024];
- ssize_t num_read = read(status_fd, buf, sizeof(buf));
- close(status_fd);
+ ssize_t num_read = HANDLE_EINTR(read(status_fd, buf, sizeof(buf)));
+ HANDLE_EINTR(close(status_fd));
if (num_read <= 0)
return false;
« no previous file with comments | « no previous file | base/directory_watcher_inotify.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698