mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Let's try forcing errno to zero before issuing fsync. The current buildfarm
results claiming EBADF seem improbable enough that I'm not convinced fsync is really returning that --- could it be failing to set errno at all?
This commit is contained in:
parent
e9a383303c
commit
9dd6c4686b
@ -11,7 +11,7 @@
|
||||
* as a service.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.30 2010/02/22 02:50:10 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.31 2010/02/22 15:29:46 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -229,9 +229,12 @@ fsync_fname(char *fname)
|
||||
(errcode_for_file_access(),
|
||||
errmsg("could not open file \"%s\": %m", fname)));
|
||||
|
||||
errno = 0;
|
||||
|
||||
if (pg_fsync(fd) != 0)
|
||||
ereport(ERROR,
|
||||
(errcode_for_file_access(),
|
||||
errmsg("could not fsync file \"%s\": %m", fname)));
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user