aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/copy.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/backend/commands/copy.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/backend/commands/copy.c')
-rw-r--r--src/backend/commands/copy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index a9c1980e5d5..e0c72d9cdc1 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -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")));