mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +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:
@ -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",
|
||||
|
Reference in New Issue
Block a user