aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/common.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-10-18 21:37:51 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-10-18 21:37:51 -0400
commitaa90e148ca70a235897b1227f1a7cd1c66bc5368 (patch)
treec8e8b677d4b687ef60bdd74dd096dc5ee45765e6 /src/bin/psql/common.c
parentc53d3a9ee1b1c85c7d905fb8ca80d327a55f1dfb (diff)
downloadpostgresql-aa90e148ca70a235897b1227f1a7cd1c66bc5368.tar.gz
postgresql-aa90e148ca70a235897b1227f1a7cd1c66bc5368.zip
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.
Diffstat (limited to 'src/bin/psql/common.c')
-rw-r--r--src/bin/psql/common.c12
1 files changed, 9 insertions, 3 deletions
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 */
}
}