From aa90e148ca70a235897b1227f1a7cd1c66bc5368 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 18 Oct 2011 21:37:51 -0400 Subject: Suppress -Wunused-result warnings about write() and fwrite(). This is merely an exercise in satisfying pedants, not a bug fix, because in every case we were checking for failure later with ferror(), or else there was nothing useful to be done about a failure anyway. Document the latter cases. --- src/bin/psql/common.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/bin/psql/common.c') diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index 101544800d2..5ab736e30b0 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -228,6 +228,7 @@ static void handle_sigint(SIGNAL_ARGS) { int save_errno = errno; + int rc; char errbuf[256]; /* if we are waiting for input, longjmp out of it */ @@ -244,11 +245,16 @@ handle_sigint(SIGNAL_ARGS) if (cancelConn != NULL) { if (PQcancel(cancelConn, errbuf, sizeof(errbuf))) - write_stderr("Cancel request sent\n"); + { + rc = write_stderr("Cancel request sent\n"); + (void) rc; /* ignore errors, nothing we can do here */ + } else { - write_stderr("Could not send cancel request: "); - write_stderr(errbuf); + rc = write_stderr("Could not send cancel request: "); + (void) rc; /* ignore errors, nothing we can do here */ + rc = write_stderr(errbuf); + (void) rc; /* ignore errors, nothing we can do here */ } } -- cgit v1.2.3