nsjail.h: different if guards for TEMP_FAILURE_RETRY
authorRobert Swiecki <robert@swiecki.net>
Wed, 8 Nov 2017 16:20:57 +0000 (17:20 +0100)
committerRobert Swiecki <robert@swiecki.net>
Wed, 8 Nov 2017 16:20:57 +0000 (17:20 +0100)
nsjail.h

index dcb327c..1b2ba9f 100644 (file)
--- a/nsjail.h
+++ b/nsjail.h
 #ifndef NS_NSJAIL_H
 #define NS_NSJAIL_H
 
-//taken from https://github.com/openhome/ohNet/issues/25
-#define _GNU_SOURCE 1
-#if defined(PLATFORM_MACOSX_GNU) || defined(PLATFORM_FREEBSD) || !defined(__GLIBC__)
-#define TEMP_FAILURE_RETRY(expression) \
-  (__extension__                                                              \
-    ({ long int __result;                                                     \
-       do __result = (long int) (expression);                                 \
-       while (__result == -1L && errno == EINTR);                             \
-       __result; }))
-#endif
-
 #include <netinet/ip6.h>
 #include <signal.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <sys/queue.h>
 #include <time.h>
+#include <unistd.h>
+
+#if !defined(TEMP_FAILURE_RETRY)
+#define TEMP_FAILURE_RETRY(expression)                     \
+       (__extension__({                                   \
+               long int __result;                         \
+               do                                         \
+                       __result = (long int)(expression); \
+               while (__result == -1L && errno == EINTR); \
+               __result;                                  \
+       }))
+#endif /* !defined(TEMP_FAILURE_RETRY) */
 
 static const int nssigs[] = {
     SIGINT,