From 4bdc96fc469a7baed63c2ddb8cf2b768775672ab Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Wed, 6 Aug 2014 23:02:46 +0100 Subject: [PATCH] [QA] Add warning if file rename fails. Probably shouldn't claim download was a complete success, but at least it may help to explain a mysterious issue (especially if fn is set to "" which I did for dev purposes) --- src/download.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/download.c b/src/download.c index d640d222..d771483f 100644 --- a/src/download.c +++ b/src/download.c @@ -361,7 +361,9 @@ static DownloadResult_t download( const char *hostname, const char *uri, const c utimes ( fn, NULL ); /* update mtime of local copy */ #endif } else { - g_rename ( tmpfilename, fn ); /* move completely-downloaded file to permanent location */ + /* move completely-downloaded file to permanent location */ + if ( g_rename ( tmpfilename, fn ) ) + g_warning ("%s: file rename failed [%s] to [%s]", __FUNCTION__, tmpfilename, fn ); } unlock_file ( tmpfilename ); g_free ( tmpfilename ); -- 2.39.5