Mageia Bugzilla – Attachment 9979 Details for
Bug 22575
handle -Wunused-result for monitor edid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Patch to fix -Wwarn-unsed warning
0001-Explicitly-do-not-check-return-value-of-write.patch (text/plain), 864 bytes, created by
Till Maas
on 2018-02-11 13:20:17 CET
(
hide
)
Description:
Patch to fix -Wwarn-unsed warning
Filename:
MIME Type:
Creator:
Till Maas
Created:
2018-02-11 13:20:17 CET
Size:
864 bytes
patch
obsolete
>From 882256b570f97b5894713a5e2789622396c5cfff Mon Sep 17 00:00:00 2001 >From: Till Maas <opensource@till.name> >Date: Sun, 11 Feb 2018 13:15:59 +0100 >Subject: [PATCH] Explicitly do not check return value of write() > >Write is called to write to stdout just before the command exists. If it fails, >there is no way to comminicate to the user, therefore just do nothing. This >eliminates a -Wwarn-unused compiler warning on Fedora. >--- > monitor-get-edid-using-vbe.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/monitor-get-edid-using-vbe.c b/monitor-get-edid-using-vbe.c >index 3f8ab1c..92662c8 100644 >--- a/monitor-get-edid-using-vbe.c >+++ b/monitor-get-edid-using-vbe.c >@@ -74,7 +74,7 @@ int main(int argc, char **argv) > } > > if (size >= 0) { >- write(1, edid, size); >+ if(write(STDOUT_FILENO, edid, size)){}; > return 0; > } > >-- >2.13.6 >
From 882256b570f97b5894713a5e2789622396c5cfff Mon Sep 17 00:00:00 2001 From: Till Maas <opensource@till.name> Date: Sun, 11 Feb 2018 13:15:59 +0100 Subject: [PATCH] Explicitly do not check return value of write() Write is called to write to stdout just before the command exists. If it fails, there is no way to comminicate to the user, therefore just do nothing. This eliminates a -Wwarn-unused compiler warning on Fedora. --- monitor-get-edid-using-vbe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor-get-edid-using-vbe.c b/monitor-get-edid-using-vbe.c index 3f8ab1c..92662c8 100644 --- a/monitor-get-edid-using-vbe.c +++ b/monitor-get-edid-using-vbe.c @@ -74,7 +74,7 @@ int main(int argc, char **argv) } if (size >= 0) { - write(1, edid, size); + if(write(STDOUT_FILENO, edid, size)){}; return 0; } -- 2.13.6
View Attachment As Raw
Actions:
View
Attachments on
bug 22575
: 9979