aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.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/access/transam/xlog.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/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index befb5070477..1c17348472e 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -9067,8 +9067,10 @@ do_pg_start_backup(const char *backupidstr, bool fast, char **labelfile)
(errcode_for_file_access(),
errmsg("could not create file \"%s\": %m",
BACKUP_LABEL_FILE)));
- fwrite(labelfbuf.data, labelfbuf.len, 1, fp);
- if (fflush(fp) || ferror(fp) || FreeFile(fp))
+ if (fwrite(labelfbuf.data, labelfbuf.len, 1, fp) != 1 ||
+ fflush(fp) != 0 ||
+ ferror(fp) ||
+ FreeFile(fp))
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not write file \"%s\": %m",