GNOME Bugzilla – Bug 121376
G_IO_HUP is not enough to detect broken pipe
Last modified: 2004-12-22 21:47:04 UTC
broken pipe must be detected by HUP|IN+read() with EOF see http://bugzilla.gnome.org/show_bug.cgi?id=121345
Created attachment 19703 [details] [review] patch to test G_IO_IN and read()
Is that pipe nonblocking? We should probably set it nonblocking if it isn't, or the read could block forever.
The read() cannot block because we read only if we have something to read, show by the G_IO_IN flag. "something" can be bytes or EOF. Moreover, if you set G_IO_IN in the poll() function and you never read when you receive G_IO_IN, the next poll() will exit immediatly because you didn't empty the pipe: you can have performance issue, a lot of CPU consumption.
Applying to cvs now, thanks.