1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

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.
This commit is contained in:
Tom Lane
2011-10-18 21:37:51 -04:00
parent c53d3a9ee1
commit aa90e148ca
5 changed files with 59 additions and 19 deletions

View File

@@ -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 */
}
}