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 ,
3434const char * progname );
3535#endif
3636static 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
191191pre_sync_fname (const char * fname ,bool isdir ,const char * progname )
192192{
193193int fd ;
@@ -197,10 +197,10 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname)
197197if (fd < 0 )
198198{
199199if (errno == EACCES || (isdir && errno == EISDIR ))
200- return ;
200+ return 0 ;
201201fprintf (stderr ,_ ("%s: could not open file \"%s\": %s\n" ),
202202progname ,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 */