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 732002 - gwakeup: Clarify buffer sizing in g_wakeup_signal()
gwakeup: Clarify buffer sizing in g_wakeup_signal()
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-06-21 09:52 UTC by Philip Withnall
Modified: 2014-06-21 16:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gwakeup: Clarify buffer sizing in g_wakeup_signal() (1.62 KB, patch)
2014-06-21 09:52 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2014-06-21 09:52:10 UTC
Patch attached. See the commit message for some rationale.
Comment 1 Philip Withnall 2014-06-21 09:52:12 UTC
Created attachment 278885 [details] [review]
gwakeup: Clarify buffer sizing in g_wakeup_signal()

The code in g_wakeup_signal() is currently correct: it writes a 64-bit
counter increment value if the FD is an eventfd, and writes an arbitrary
8-bit value if using a normal pipe.

However, the reasoning behind these buffer sizes is not clear, and the
mismatch between the allocated buffer size and the length passed to
write() in the pipe case could be mistaken for a bug.

Coverity issue: #1159490
Comment 2 Colin Walters 2014-06-21 11:48:35 UTC
Review of attachment 278885 [details] [review]:

Yep, makes sense.  Excellent commit message.
Comment 3 Philip Withnall 2014-06-21 16:42:33 UTC
Comment on attachment 278885 [details] [review]
gwakeup: Clarify buffer sizing in g_wakeup_signal()

commit 6b8ae8f21b909102b4279900e90cb294cf542188
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sat Jun 21 10:48:08 2014 +0100

    gwakeup: Clarify buffer sizing in g_wakeup_signal()
    
    The code in g_wakeup_signal() is currently correct: it writes a 64-bit
    counter increment value if the FD is an eventfd, and writes an arbitrary
    8-bit value if using a normal pipe.
    
    However, the reasoning behind these buffer sizes is not clear, and the
    mismatch between the allocated buffer size and the length passed to
    write() in the pipe case could be mistaken for a bug.
    
    Coverity issue: #1159490
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732002

 glib/gwakeup.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)