(safe_read): Use IS_EINTR in place of in-function cpp directives.
+#ifdef EINTR
+# define IS_EINTR(x) ((x) == EINTR)
+#else
+# define IS_EINTR(x) 0
+#endif
+
#include <limits.h>
#ifndef CHAR_BIT
#include <limits.h>
#ifndef CHAR_BIT
{
result = read (fd, buf, nbytes_to_read);
}
{
result = read (fd, buf, nbytes_to_read);
}
-#ifdef EINTR
- while (result < 0 && errno == EINTR);
-#else
- while (0);
-#endif
+ while (result < 0 && IS_EINTR (errno));
return (size_t) result;
}
return (size_t) result;
}