mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 03:02:10 +01:00
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:
parent
b76bb6713b
commit
230efe70f4
@ -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;
|
create_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
|
||||||
fid = open (filename, flags, create_mode);
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
fid = open (filename, flags, create_mode);
|
||||||
|
}
|
||||||
|
while (fid == -1 && errno == EINTR);
|
||||||
|
|
||||||
if (fid == -1)
|
if (fid == -1)
|
||||||
{
|
{
|
||||||
int err = errno;
|
int err = errno;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user