nsjail.h: different if guards for TEMP_FAILURE_RETRY

This commit is contained in:
Robert Swiecki 2017-11-08 17:20:57 +01:00
parent 26d0a278c6
commit d7bcad2076

View File

@ -23,17 +23,6 @@
#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>
@ -41,6 +30,18 @@
#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,