diff --git a/glib/gmessages.c b/glib/gmessages.c index 91d7a21f1..d346eafdc 100644 --- a/glib/gmessages.c +++ b/glib/gmessages.c @@ -281,7 +281,10 @@ static void write_string (int fd, const gchar *string) { - write (fd, string, strlen (string)); + int res; + do + res = write (fd, string, strlen (string)); + while (G_UNLIKELY (res == -1 && errno == EINTR)); } static GLogDomain* diff --git a/glib/gwakeup.c b/glib/gwakeup.c index bb490594f..ad92d5678 100644 --- a/glib/gwakeup.c +++ b/glib/gwakeup.c @@ -230,11 +230,20 @@ void g_wakeup_signal (GWakeup *wakeup) { guint64 one = 1; + int res; if (wakeup->fds[1] == -1) - write (wakeup->fds[0], &one, sizeof one); + { + do + res = write (wakeup->fds[0], &one, sizeof one); + while (G_UNLIKELY (res == -1 && errno == EINTR)); + } else - write (wakeup->fds[1], &one, 1); + { + do + write (wakeup->fds[1], &one, 1); + while (G_UNLIKELY (res == -1 && errno == EINTR)); + } } /**