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 603510 - Build failure due sigterm_handler function: error: ignoring return value of ‘write’
Build failure due sigterm_handler function: error: ignoring return value of ‘...
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
trunk
Other Linux
: Normal blocker
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2009-12-01 18:18 UTC by Luca Ferretti
Modified: 2017-09-29 20:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix the compiler warning, make use of the return value (454 bytes, patch)
2009-12-09 00:01 UTC, Christian Kirbach
committed Details | Review

Description Luca Ferretti 2009-12-01 18:18:22 UTC
From jhbuild log:

cc1: warnings being treated as errors
core/main.c: In function ‘sigterm_handler’:
core/main.c:380: error: ignoring return value of ‘write’, declared with attribute warn_unused_result
Comment 1 Christian Kirbach 2009-12-08 23:35:51 UTC
I see this as well
Comment 2 Christian Kirbach 2009-12-09 00:01:13 UTC
Created attachment 149385 [details] [review]
fix the compiler warning, make use of the return value

googling I found this elegant solution of using the return value for something, thus bringing remedy for the compiler warning. Am I not sneaky? :)
Not sure if you want this error logged or printed to stderr, as I did.
Comment 3 Christian Kirbach 2009-12-10 15:02:51 UTC
gcc version 4.4.1
Comment 4 Thomas Thurman 2011-01-15 23:11:18 UTC
Review of attachment 149385 [details] [review]:

Sorry for the ridiculously long delay.  I'll try to do better in future.

I actually found and fixed this bug independently, a month after you raised it (in commit 575f5):

http://git.gnome.org/browse/metacity/commit/?id=575f5204

But I think your solution is better, so I'm adopting it instead.
Comment 5 Thomas Thurman 2011-01-15 23:15:56 UTC
Checked into master:
http://git.gnome.org/browse/metacity/commit/?id=5389959edc3372fe43caf2230f6922c35c8b04e6

-> FIXED
Comment 6 Ray Strode [halfline] 2012-01-05 15:07:10 UTC
Hey,

The commit mentioned in comment 5 isn't actually valid.  It's illegal (can lead to crashes or deadlocks) to call g_printerr in a signal handler.