From: Felix Fietkau Date: Fri, 10 Apr 2015 19:59:06 +0000 (+0200) Subject: do not rely on libc providing TEMP_FAILURE_RETRY X-Git-Url: http://git.openwrt.org/?p=project%2Flibrpc-uclibc.git;a=commitdiff_plain;h=308e9964bfb623773dc0dcc99ef9d18d1551d6ae do not rely on libc providing TEMP_FAILURE_RETRY Signed-off-by: Felix Fietkau --- diff --git a/rexec.c b/rexec.c index 4148fdd..c60c1ba 100644 --- a/rexec.c +++ b/rexec.c @@ -42,6 +42,13 @@ #include #include +# define __TEMP_FAILURE_RETRY(expression) \ + (__extension__ \ + ({ long int __result; \ + do __result = (long int) (expression); \ + while (__result == -1L && errno == EINTR); \ + __result; })) + #define SA_LEN(_x) __libc_sa_len((_x)->sa_family) extern int __libc_sa_len(sa_family_t __af) __THROW attribute_hidden; @@ -138,7 +145,7 @@ retry: (void) write(s, num, strlen(num)+1); { socklen_t len = sizeof(from); - s3 = TEMP_FAILURE_RETRY(accept(s2, + s3 = __TEMP_FAILURE_RETRY(accept(s2, (struct sockaddr *)&from, &len)); close(s2); if (s3 < 0) {