diff options
Diffstat (limited to 'include/qemu')
-rw-r--r-- | include/qemu/osdep.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index b9c4307..7d059ad 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -251,7 +251,13 @@ void QEMU_ERROR("code path is reachable") #define ESHUTDOWN 4099 #endif -#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) +#define RETRY_ON_EINTR(expr) \ + (__extension__ \ + ({ typeof(expr) __result; \ + do { \ + __result = (expr); \ + } while (__result == -1 && errno == EINTR); \ + __result; })) /* time_t may be either 32 or 64 bits depending on the host OS, and * can be either signed or unsigned, so we can't just hardcode a |