summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOrion Hodson <oth@google.com>2019-01-29 06:52:07 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-01-29 06:52:07 -0800
commit75325cc476a7071f4f596d3831abc37955e4c62b (patch)
tree4d5e2928ac0e5827193a90a2c2830031fbf82ff1
parent9fed5465c6a5818e41159aad7764c2bd7b8c3fa8 (diff)
parent508151e83cbb7ff7476c12d99ccab714400df5ed (diff)
downloaddalvik-75325cc476a7071f4f596d3831abc37955e4c62b.tar.gz
Merge "Remove unused libnativehelper include." am: 9c98845827
am: 508151e83c Change-Id: Ia6697fd458f8216501827f7415cd05b5c6c45b72
-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"