unbelieveable, but close() can actually fail
This commit is contained in:
parent
d7b8621f05
commit
630a04ad3e
13
src/sync.c
13
src/sync.c
|
@ -35,6 +35,15 @@
|
||||||
|
|
||||||
static const char *str_ms[] = { "master", "slave" }, *str_hl[] = { "push", "pull" };
|
static const char *str_ms[] = { "master", "slave" }, *str_hl[] = { "push", "pull" };
|
||||||
|
|
||||||
|
void
|
||||||
|
Fclose( FILE *f )
|
||||||
|
{
|
||||||
|
if (fclose( f ) == EOF) {
|
||||||
|
perror( "cannot close file" );
|
||||||
|
exit( 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Fprintf( FILE *f, const char *msg, ... )
|
Fprintf( FILE *f, const char *msg, ... )
|
||||||
{
|
{
|
||||||
|
@ -1168,8 +1177,8 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan )
|
||||||
srec->status & S_EXPIRED ? "X" : "", fbuf );
|
srec->status & S_EXPIRED ? "X" : "", fbuf );
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose( nfp );
|
Fclose( nfp );
|
||||||
fclose( jfp );
|
Fclose( jfp );
|
||||||
if (!(DFlags & KEEPJOURNAL)) {
|
if (!(DFlags & KEEPJOURNAL)) {
|
||||||
/* order is important! */
|
/* order is important! */
|
||||||
rename( nname, dname );
|
rename( nname, dname );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user