From: Michael Brown Date: Mon, 26 Mar 2012 21:47:50 +0000 (+0100) Subject: [downloader] Log final status of all downloads X-Git-Tag: v1.20.1~1885 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a91f5646aac3456d5be40319129dac5c5f877f0;p=thirdparty%2Fipxe.git [downloader] Log final status of all downloads Signed-off-by: Michael Brown --- diff --git a/src/core/downloader.c b/src/core/downloader.c index 4dc0aa02a..612a66334 100644 --- a/src/core/downloader.c +++ b/src/core/downloader.c @@ -21,6 +21,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include +#include #include #include #include @@ -73,6 +74,15 @@ static void downloader_free ( struct refcnt *refcnt ) { */ static void downloader_finished ( struct downloader *downloader, int rc ) { + /* Log download status */ + if ( rc == 0 ) { + syslog ( LOG_NOTICE, "Downloaded \"%s\"\n", + downloader->image->name ); + } else { + syslog ( LOG_ERR, "Download of \"%s\" failed: %s\n", + downloader->image->name, strerror ( rc ) ); + } + /* Shut down interfaces */ intf_shutdown ( &downloader->xfer, rc ); intf_shutdown ( &downloader->job, rc );