Skip to content

Commit 9dd6c46

Browse files
committed
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?
1 parent e9a3833 commit 9dd6c46

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/port/copydir.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* as a service.
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.30 2010/02/22 02:50:10 tgl Exp $
14+
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.31 2010/02/22 15:29:46 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -229,9 +229,12 @@ fsync_fname(char *fname)
229229
(errcode_for_file_access(),
230230
errmsg("could not open file \"%s\": %m", fname)));
231231

232+
errno = 0;
233+
232234
if (pg_fsync(fd) != 0)
233235
ereport(ERROR,
234236
(errcode_for_file_access(),
235237
errmsg("could not fsync file \"%s\": %m", fname)));
238+
236239
close(fd);
237240
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy