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:50:20 +1300
commitf16735d80d2fbe1c86f4ac044ee66fe2073b8877 (patch)
treec8ff214a86e291794a32eee91fe25f69625fbf2f /src/common/file_utils.c
parent483520eca426fb1b428e8416d1d014ac5ad80ef4 (diff)
downloadpostgresql-f16735d80d2fbe1c86f4ac044ee66fe2073b8877.tar.gz
postgresql-f16735d80d2fbe1c86f4ac044ee66fe2073b8877.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 4bcb9c1e058..c25713d0e50 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));