aboutsummaryrefslogtreecommitdiff
path: root/src/common/file_utils.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2019-02-24 23:48:52 +1300
committerThomas Munro <tmunro@postgresql.org>2019-02-24 23:51:54 +1300
commit4d67357dbf5016836dc9ea9a8789cc539dfa3b60 (patch)
tree19ec07a24168a31ec9be80966803969dc8f128e9 /src/common/file_utils.c
parent30dcb6270c915691fb82477f6b3c489977cae050 (diff)
downloadpostgresql-4d67357dbf5016836dc9ea9a8789cc539dfa3b60.tar.gz
postgresql-4d67357dbf5016836dc9ea9a8789cc539dfa3b60.zip
Tolerate EINVAL when calling fsync() on a directory.
Previously, we tolerated EBADF as a way for the operating system to indicate that it doesn't support fsync() on a directory. Tolerate EINVAL too, for older versions of Linux CIFS. Bug #15636. Back-patch all the way. Reported-by: John Klann Discussion: https://postgr.es/m/15636-d380890dafd78fc6@postgresql.org
Diffstat (limited to 'src/common/file_utils.c')
-rw-r--r--src/common/file_utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/file_utils.c b/src/common/file_utils.c
index 48876061c38..af8746fc701 100644
--- a/src/common/file_utils.c
+++ b/src/common/file_utils.c
@@ -299,7 +299,7 @@ fsync_fname(const char *fname, bool isdir, const char *progname)
* Some OSes don't allow us to fsync directories at all, so we can ignore
* those errors. Anything else needs to be reported.
*/
- if (returncode != 0 && !(isdir && errno == EBADF))
+ if (returncode != 0 && !(isdir && (errno == EBADF || errno == EINVAL)))
{
fprintf(stderr, _("%s: could not fsync file \"%s\": %s\n"),
progname, fname, strerror(errno));