summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOrion Hodson <oth@google.com>2019-01-29 06:41:47 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-01-29 06:41:47 -0800
commit508151e83cbb7ff7476c12d99ccab714400df5ed (patch)
tree4d5e2928ac0e5827193a90a2c2830031fbf82ff1
parent991373da43fc829a73f4e788abe3cbf8feacfbca (diff)
parent9c98845827afbe8e3edb81b9c4fe64de8a6b01a3 (diff)
downloaddalvik-508151e83cbb7ff7476c12d99ccab714400df5ed.tar.gz
Merge "Remove unused libnativehelper include."
am: 9c98845827 Change-Id: I7e979be93f245e9b2c62a1866b74127d7b43b448
-rw-r--r--libdex/SysUtil.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/libdex/SysUtil.cpp b/libdex/SysUtil.cpp
index 13d11ff83..3a1cba3b5 100644
--- a/libdex/SysUtil.cpp
+++ b/libdex/SysUtil.cpp
@@ -30,8 +30,20 @@
#include <limits.h>
#include <errno.h>
-#include <nativehelper/JNIHelp.h> // TEMP_FAILURE_RETRY may or may not be in unistd
-
+/*
+ * TEMP_FAILURE_RETRY is defined by some, but not all, versions of
+ * <unistd.h>. (Alas, it is not as standard as we'd hoped!) So, if it's
+ * not already defined, then define it here.
+ */
+#ifndef TEMP_FAILURE_RETRY
+/* Used to retry syscalls that can return EINTR. */
+#define TEMP_FAILURE_RETRY(exp) ({ \
+ typeof (exp) _rc; \
+ do { \
+ _rc = (exp); \
+ } while (_rc == -1 && errno == EINTR); \
+ _rc; })
+#endif
/*
* Create an anonymous shared memory segment large enough to hold "length"