Commit f2af8dc5 authored by Peter Eisentraut's avatar Peter Eisentraut

Fix compiler warnings

This was missed in bf5bb2e8, because the
code is only visible under PG_FLUSH_DATA_WORKS.
parent 8e91e12b
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#endif #endif
#ifdef PG_FLUSH_DATA_WORKS #ifdef PG_FLUSH_DATA_WORKS
static void pre_sync_fname(const char *fname, bool isdir, static int pre_sync_fname(const char *fname, bool isdir,
const char *progname); const char *progname);
#endif #endif
static void walkdir(const char *path, static void walkdir(const char *path,
...@@ -187,7 +187,7 @@ walkdir(const char *path, ...@@ -187,7 +187,7 @@ walkdir(const char *path,
*/ */
#ifdef PG_FLUSH_DATA_WORKS #ifdef PG_FLUSH_DATA_WORKS
static void static int
pre_sync_fname(const char *fname, bool isdir, const char *progname) pre_sync_fname(const char *fname, bool isdir, const char *progname)
{ {
int fd; int fd;
...@@ -197,10 +197,10 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname) ...@@ -197,10 +197,10 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname)
if (fd < 0) if (fd < 0)
{ {
if (errno == EACCES || (isdir && errno == EISDIR)) if (errno == EACCES || (isdir && errno == EISDIR))
return; return 0;
fprintf(stderr, _("%s: could not open file \"%s\": %s\n"), fprintf(stderr, _("%s: could not open file \"%s\": %s\n"),
progname, fname, strerror(errno)); progname, fname, strerror(errno));
return; return -1;
} }
/* /*
...@@ -217,6 +217,7 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname) ...@@ -217,6 +217,7 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname)
#endif #endif
(void) close(fd); (void) close(fd);
return 0;
} }
#endif /* PG_FLUSH_DATA_WORKS */ #endif /* PG_FLUSH_DATA_WORKS */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment