30
30
#endif
31
31
32
32
#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 ,
34
34
const char * progname );
35
35
#endif
36
36
static void walkdir (const char * path ,
@@ -187,7 +187,7 @@ walkdir(const char *path,
187
187
*/
188
188
#ifdef PG_FLUSH_DATA_WORKS
189
189
190
- static void
190
+ static int
191
191
pre_sync_fname (const char * fname ,bool isdir ,const char * progname )
192
192
{
193
193
int fd ;
@@ -197,10 +197,10 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname)
197
197
if (fd < 0 )
198
198
{
199
199
if (errno == EACCES || (isdir && errno == EISDIR ))
200
- return ;
200
+ return 0 ;
201
201
fprintf (stderr ,_ ("%s: could not open file \"%s\": %s\n" ),
202
202
progname ,fname ,strerror (errno ));
203
- return ;
203
+ return -1 ;
204
204
}
205
205
206
206
/*
@@ -217,6 +217,7 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname)
217
217
#endif
218
218
219
219
(void )close (fd );
220
+ return 0 ;
220
221
}
221
222
222
223
#endif /* PG_FLUSH_DATA_WORKS */