mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
Handle EINTR for a few more write() calls
https://bugzilla.gnome.org/show_bug.cgi?id=682819
This commit is contained in:
parent
2ab5ed84b2
commit
090f874626
@ -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*
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user