open(2): POSIX compatibility.

Posix allows for open(2) to fail with errno = EINTR.
Normal this isn't seen when opening files. However in some case we are
opening a fifo for write which will block until another process opens it
for read. If a signal is received while blocked, open(2) fails with
errno = EINTR.

https://bugzilla.gnome.org/show_bug.cgi?id=656492
This commit is contained in:
Antoine Jacoutot 2011-08-14 01:23:36 +02:00 committed by Colin Walters
parent b76bb6713b
commit 230efe70f4

View File

@ -524,7 +524,13 @@ g_io_channel_new_file (const gchar *filename,
}
create_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
do
{
fid = open (filename, flags, create_mode);
}
while (fid == -1 && errno == EINTR);
if (fid == -1)
{
int err = errno;