Skip to content

Commit f2af8dc

Browse files
committed
Fix compiler warnings
This was missed in bf5bb2e, because the code is only visible under PG_FLUSH_DATA_WORKS.
1 parent 8e91e12 commit f2af8dc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/common/file_utils.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#endif
3131

3232
#ifdef PG_FLUSH_DATA_WORKS
33-
static void pre_sync_fname(const char *fname, bool isdir,
33+
static int pre_sync_fname(const char *fname, bool isdir,
3434
const char *progname);
3535
#endif
3636
static void walkdir(const char *path,
@@ -187,7 +187,7 @@ walkdir(const char *path,
187187
*/
188188
#ifdef PG_FLUSH_DATA_WORKS
189189

190-
static void
190+
static int
191191
pre_sync_fname(const char *fname, bool isdir, const char *progname)
192192
{
193193
int fd;
@@ -197,10 +197,10 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname)
197197
if (fd < 0)
198198
{
199199
if (errno == EACCES || (isdir && errno == EISDIR))
200-
return;
200+
return 0;
201201
fprintf(stderr, _("%s: could not open file \"%s\": %s\n"),
202202
progname, fname, strerror(errno));
203-
return;
203+
return -1;
204204
}
205205

206206
/*
@@ -217,6 +217,7 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname)
217217
#endif
218218

219219
(void) close(fd);
220+
return 0;
220221
}
221222

222223
#endif /* PG_FLUSH_DATA_WORKS */

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