Skip to content

Commit

Permalink
Fix pinns compilation for TEMP_FAILURE_RETRY
Browse files Browse the repository at this point in the history
In case the macro is not available we now define it on our own in the
utils.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
  • Loading branch information
saschagrunert committed Aug 31, 2020
1 parent be9e42b commit b6db1d8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pinns/utils.h
Expand Up @@ -10,6 +10,17 @@
#include <syslog.h>
#include <unistd.h>

#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

#define _pexit(s) \
do { \
fprintf(stderr, "[pinns:e]: %s: %s\n", s, strerror(errno)); \
Expand Down

0 comments on commit b6db1d8

Please sign in to comment.