1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Ensure that close() and fclose() are checked for errors, at least in

cases involving writes.  Per recent discussion about the possibility
of close-time failures on some filesystems.  There is a TODO item for
this, too.
This commit is contained in:
Tom Lane
2004-01-26 22:35:32 +00:00
parent e0707cbae9
commit c77f363384
15 changed files with 155 additions and 56 deletions

View File

@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.180 2004/01/24 20:00:45 wieck Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.181 2004/01/26 22:35:32 tgl Exp $
*
*--------------------------------------------------------------------
*/
@ -3971,7 +3971,16 @@ write_nondefault_variables(GucContext context)
}
}
FreeFile(fp);
if (FreeFile(fp))
{
free(new_filename);
free(filename);
ereport(elevel,
(errcode_for_file_access(),
errmsg("could not write to file \"%s\": %m", CONFIG_EXEC_PARAMS)));
return;
}
/* Put new file in place, this could delay on Win32 */
rename(new_filename, filename);
free(new_filename);