ngtcp2_unreachable: Handle EINTR
#include "ngtcp2_unreachable.h"
#include <stdio.h>
+#include <errno.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
@@ -58,7 +59,8 @@ void ngtcp2_unreachable_fail(const char *file, int line, const char *func) {
}
#ifndef WIN32
- write(STDERR_FILENO, buf, (size_t)rv);
+ while (write(STDERR_FILENO, buf, (size_t)rv) == -1 && errno == EINTR)
+ ;
#else /* WIN32 */
_write(_fileno(stderr), buf, (unsigned int)rv);
#endif /* WIN32 */
