glib has lots of missing handling for EINTR
Submitted by Antoine Jacoutot
Link to original bug (#656492)
Description
Created attachment 193799 make g_io_channel_new_file follow POSIX
Hi.
Kurt Miller from OpenBSD found an issue with glib while working on porting IcedTea-Web/openjdk (Error: Failed to create output channel: Interrupted system call). g_io_channel_new_file() is used to create a plugin-to-appletviewer channel and fails.
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.
Using a small test program showed that a signal received while open(2) is blocked will return EINTR on at least OpenBSD, FreeBSD, Mac OS X and Solaris; so it seems only linux ignores the signal.
Here's Kurt's patch to fix the issue.
Thoughts?
Patch 193799, "make g_io_channel_new_file follow POSIX":
0001-open-2-POSIX-compatibility.patch
Version: 2.28.x