Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+5-4
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)