Merge "Fix TEMP_FAILURE_RETRY on non-GNU C++ dialects" am: addba34668
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2025446 Change-Id: I6a84e6300416c664f0b83dba77a5d7358873dbfe
This commit is contained in:
commit
aae9c4ec53
1 changed files with 9 additions and 11 deletions
|
@ -71,19 +71,17 @@ static inline int ftruncate64(int fd, off64_t length) {
|
|||
#define CONSTEXPR
|
||||
#endif
|
||||
|
||||
/*
|
||||
* TEMP_FAILURE_RETRY is defined by some, but not all, versions of
|
||||
* <unistd.h>. (Alas, it is not as standard as we'd hoped!) So, if it's
|
||||
* not already defined, then define it here.
|
||||
*/
|
||||
/* TEMP_FAILURE_RETRY is not available on macOS, but still useful there. */
|
||||
#ifndef TEMP_FAILURE_RETRY
|
||||
/* Used to retry syscalls that can return EINTR. */
|
||||
#define TEMP_FAILURE_RETRY(exp) ({ \
|
||||
typeof (exp) _rc; \
|
||||
do { \
|
||||
_rc = (exp); \
|
||||
} while (_rc == -1 && errno == EINTR); \
|
||||
_rc; })
|
||||
#define TEMP_FAILURE_RETRY(exp) \
|
||||
({ \
|
||||
__typeof__(exp) _rc; \
|
||||
do { \
|
||||
_rc = (exp); \
|
||||
} while (_rc == -1 && errno == EINTR); \
|
||||
_rc; \
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
|
Loading…
Reference in a new issue