]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix Wunused-result compile warnings.
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Sun, 4 Jul 2021 13:19:24 +0000 (15:19 +0200)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Sun, 4 Jul 2021 13:19:24 +0000 (15:19 +0200)
dnstap/unbound-dnstap-socket.c
doc/Changelog
testcode/delayer.c
testcode/streamtcp.c

index 17c29e9718da6cb42b8567fbdba7829b0dce8b19..3de8ab3f0899bd52b361da62e7ac9dd29594ec6b 100644 (file)
@@ -1171,7 +1171,8 @@ static RETSIGTYPE main_sigh(int sig)
                char str[] = "exit on signal   \n";
                str[15] = '0' + (sig/10)%10;
                str[16] = '0' + sig%10;
-               write(STDERR_FILENO, str, strlen(str));
+               /* simple cast to void will not silence Wunused-result */
+               (void)!write(STDERR_FILENO, str, strlen(str));
        }
        if(sig_base) {
                ub_event_base_loopexit(sig_base);
index 3844919205df921e447717f41120ffd61c783e0a..b8f65cf7a34f57f6c3e622601bef19fff5dc6209 100644 (file)
@@ -1,3 +1,6 @@
+4 July 2021: George
+       - Fix Wunused-result compile warnings.
+
 2 July 2021: Tom
        - Merge PR #491: Add SVCB and HTTPS types and handling according to draft-ietf-dnsop-svcb-https
 
index 0c8f2a45d3b2b86fd60d53845b3f9efcaedfc500..e915961f5ae7becc4aac2c026a15e57b89b01e80 100644 (file)
@@ -350,7 +350,8 @@ static RETSIGTYPE delayer_sigh(int sig)
        char str[] = "exit on signal   \n";
        str[15] = '0' + (sig/10)%10;
        str[16] = '0' + sig%10;
-       write(STDOUT_FILENO, str, strlen(str));
+       /* simple cast to void will not silence Wunused-result */
+       (void)!write(STDOUT_FILENO, str, strlen(str));
        do_quit = 1;
 }
 
index 3fbb792e5100888d2704e71eec89760a9119ad6e..2bd076ee5db2af69aaab34982b544052f539b771 100644 (file)
@@ -400,12 +400,14 @@ static RETSIGTYPE sigh(int sig)
        char str[] = "Got unhandled signal   \n";
        if(sig == SIGPIPE) {
                char* strpipe = "got SIGPIPE, remote connection gone\n";
-               write(STDOUT_FILENO, strpipe, strlen(strpipe));
+               /* simple cast to void will not silence Wunused-result */
+               (void)!write(STDOUT_FILENO, strpipe, strlen(strpipe));
                exit(1);
        }
        str[21] = '0' + (sig/10)%10;
        str[22] = '0' + sig%10;
-       write(STDOUT_FILENO, str, strlen(str));
+       /* simple cast to void will not silence Wunused-result */
+       (void)!write(STDOUT_FILENO, str, strlen(str));
        exit(1);
 }
 #endif /* SIGPIPE */