diff --git a/adb/sysdeps.h b/adb/sysdeps.h index ee7cd495e..0252ef3b8 100644 --- a/adb/sysdeps.h +++ b/adb/sysdeps.h @@ -277,6 +277,21 @@ extern char* adb_strtok_r(char *str, const char *delim, char **saveptr); #include #include +/* + * TEMP_FAILURE_RETRY is defined by some, but not all, versions of + * . (Alas, it is not as standard as we'd hoped!) So, if it's + * not already defined, then define it here. + */ +#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; }) +#endif + #define OS_PATH_SEPARATOR '/' #define OS_PATH_SEPARATOR_STR "/" #define ENV_PATH_SEPARATOR_STR ":"