From c1e1fedff9d2ffc8bc06294fa4316aed7d9f1007 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 17 Jan 2009 15:08:20 +0000 Subject: [PATCH] (trunk libT) check in some of the extra error logging messages developed last night while chasing down the problem denis found --- libtransmission/fdlimit.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libtransmission/fdlimit.c b/libtransmission/fdlimit.c index e4fa0c53e..1af6ae3d3 100644 --- a/libtransmission/fdlimit.c +++ b/libtransmission/fdlimit.c @@ -203,7 +203,10 @@ TrOpenFile( int i, /* confirm the parent folder exists */ if( stat( folder, &sb ) || !S_ISDIR( sb.st_mode ) ) + { + tr_err( _( "Couldn't create \"%1$s\": parent folder \"%2$s\" does not exist" ), torrentFile, folder ); return ENOENT; + } /* create subfolders, if any */ filename = tr_buildPath( folder, torrentFile, NULL ); @@ -211,11 +214,13 @@ TrOpenFile( int i, { char * tmp = tr_dirname( filename ); const int err = tr_mkdirp( tmp, 0777 ) ? errno : 0; - tr_free( tmp ); if( err ) { + tr_err( _( "Couldn't create \"%1$s\": %2$s" ), tmp, tr_strerror( err ) ); + tr_free( tmp ); tr_free( filename ); return err; } + tr_free( tmp ); } alreadyExisted = !stat( filename, &sb ) && S_ISREG( sb.st_mode ); @@ -236,8 +241,7 @@ TrOpenFile( int i, if( file->fd == -1 ) { const int err = errno; - tr_err( _( "Couldn't open \"%1$s\": %2$s" ), filename, - tr_strerror( err ) ); + tr_err( _( "Couldn't open \"%1$s\": %2$s" ), filename, tr_strerror( err ) ); tr_free( filename ); return err; }