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:
@@ -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 */
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user