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

Unified Diff: runtime/platform/globals.h

Issue 9139011: Handle EINTR on all IO operations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed building on Mac OS Created 8 years, 11 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 | « runtime/bin/socket_macos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/globals.h
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index fe7331827fa557b1e38a849b3d61a62a801fc17b..ad5aabcfc5620ca5613210dea3d9ca58518dbda4 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -39,6 +39,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <unistd.h>
#if defined(_WIN32)
#include "platform/c99_support_win.h"
@@ -102,4 +103,17 @@ static inline void USE(T) { }
#define strtok_r strtok_s
#endif
+#if !defined(TARGET_OS_WINDOWS) && !defined(TEMP_FAILURE_RETRY)
+// TEMP_FAILURE_RETRY is defined in unistd.h on some platforms. The
+// definition below is copied from Linux and adapted to avoid lint
+// errors (type long int changed to int64_t and do/while split on
+// separate lines with body in {}s).
+# define TEMP_FAILURE_RETRY(expression) \
+ ({ int64_t __result; \
+ do { \
+ __result = (int64_t) (expression); \
+ } while (__result == -1L && errno == EINTR); \
+ __result; })
+#endif
+
#endif // PLATFORM_GLOBALS_H_
« no previous file with comments | « runtime/bin/socket_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698