Skip to content

Commit

Permalink
Added macro TEMP_FAILURE_RETRY for musl and LEDE. Thanks to laoshaw
Browse files Browse the repository at this point in the history
  • Loading branch information
kvic-z committed Oct 28, 2017
1 parent 0ec6533 commit 10c4351
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions util.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
# define DEFAULT_STATS_URL "/servstats"
# define DEFAULT_STATS_TEXT_URL "/servstats.txt"

/* taken from glibc unistd.h and fixes musl */
#ifndef TEMP_FAILURE_RETRY
#define TEMP_FAILURE_RETRY(expression) \
(__extension__ \
({ long int __result; \
do __result = (long int) (expression); \
while (__result == -1L && errno == EINTR); \
__result; }))
#endif

#ifdef TEST
# define TESTPRINT printf
#else
Expand Down

0 comments on commit 10c4351

Please sign in to comment.