mirror of
https://github.com/postgres/postgres.git
synced 2026-04-23 23:28:01 -04:00
Fix compiler warnings
This was missed in bf5bb2e85b, because the
code is only visible under PG_FLUSH_DATA_WORKS.
This commit is contained in:
parent
8e91e12bc3
commit
f2af8dc5ba
1 changed files with 5 additions and 4 deletions
|
|
@ -30,7 +30,7 @@
|
|||
#endif
|
||||
|
||||
#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);
|
||||
#endif
|
||||
static void walkdir(const char *path,
|
||||
|
|
@ -187,7 +187,7 @@ walkdir(const char *path,
|
|||
*/
|
||||
#ifdef PG_FLUSH_DATA_WORKS
|
||||
|
||||
static void
|
||||
static int
|
||||
pre_sync_fname(const char *fname, bool isdir, const char *progname)
|
||||
{
|
||||
int fd;
|
||||
|
|
@ -197,10 +197,10 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname)
|
|||
if (fd < 0)
|
||||
{
|
||||
if (errno == EACCES || (isdir && errno == EISDIR))
|
||||
return;
|
||||
return 0;
|
||||
fprintf(stderr, _("%s: could not open file \"%s\": %s\n"),
|
||||
progname, fname, strerror(errno));
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -217,6 +217,7 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname)
|
|||
#endif
|
||||
|
||||
(void) close(fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* PG_FLUSH_DATA_WORKS */
|
||||
|
|
|
|||
Loading…
Reference in a new issue