mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +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:
@ -466,9 +466,9 @@ CopySendEndOfRow(CopyState cstate)
|
||||
#endif
|
||||
}
|
||||
|
||||
(void) fwrite(fe_msgbuf->data, fe_msgbuf->len,
|
||||
1, cstate->copy_file);
|
||||
if (ferror(cstate->copy_file))
|
||||
if (fwrite(fe_msgbuf->data, fe_msgbuf->len, 1,
|
||||
cstate->copy_file) != 1 ||
|
||||
ferror(cstate->copy_file))
|
||||
ereport(ERROR,
|
||||
(errcode_for_file_access(),
|
||||
errmsg("could not write to COPY file: %m")));
|
||||
|
Reference in New Issue
Block a user