After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 121376 - G_IO_HUP is not enough to detect broken pipe
G_IO_HUP is not enough to detect broken pipe
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
unspecified
Other other
: Normal major
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2003-09-03 16:34 UTC by Laurent Vivier
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to test G_IO_IN and read() (624 bytes, patch)
2003-09-03 16:35 UTC, Laurent Vivier
none Details | Review

Description Laurent Vivier 2003-09-03 16:34:20 UTC
broken pipe must be detected by HUP|IN+read() with EOF

see http://bugzilla.gnome.org/show_bug.cgi?id=121345
Comment 1 Laurent Vivier 2003-09-03 16:35:13 UTC
Created attachment 19703 [details] [review]
patch to test G_IO_IN and read()
Comment 2 Havoc Pennington 2003-09-03 20:59:59 UTC
Is that pipe nonblocking? We should probably set it nonblocking 
if it isn't, or the read could block forever.
Comment 3 Laurent Vivier 2003-09-04 07:46:56 UTC
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.
Comment 4 Havoc Pennington 2003-09-25 01:47:14 UTC
Applying to cvs now, thanks.