From aa0118d047444873f20a6900e040619a9c6f5cef Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 12 Apr 2014 18:30:09 +0200 Subject: [PATCH] better error messages for sync state and journal related errors we can make perfectly good use of errno here. --- src/sync.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sync.c b/src/sync.c index 353d1ac..e97efe8 100644 --- a/src/sync.c +++ b/src/sync.c @@ -787,7 +787,7 @@ box_selected( int sts, void *aux ) fclose( jfp ); } else { if (errno != ENOENT) { - error( "Error: cannot read sync state %s\n", svars->dname ); + sys_error( "Error: cannot read sync state %s", svars->dname ); goto bail; } } @@ -932,7 +932,7 @@ box_selected( int sts, void *aux ) fclose( jfp ); } else { if (errno != ENOENT) { - error( "Error: cannot read journal %s\n", svars->jname ); + sys_error( "Error: cannot read journal %s", svars->jname ); goto bail; } } @@ -948,11 +948,11 @@ box_selected( int sts, void *aux ) goto bail; if (!(svars->nfp = fopen( svars->nname, "w" ))) { - error( "Error: cannot write new sync state %s\n", svars->nname ); + sys_error( "Error: cannot create new sync state %s", svars->nname ); goto bail; } if (!(svars->jfp = fopen( svars->jname, "a" ))) { - error( "Error: cannot write journal %s\n", svars->jname ); + sys_error( "Error: cannot create journal %s", svars->jname ); fclose( svars->nfp ); goto bail; }