mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 09:32:33 +03:00
[downloader] Log final status of all downloads
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -21,6 +21,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <syslog.h>
|
||||||
#include <ipxe/iobuf.h>
|
#include <ipxe/iobuf.h>
|
||||||
#include <ipxe/xfer.h>
|
#include <ipxe/xfer.h>
|
||||||
#include <ipxe/open.h>
|
#include <ipxe/open.h>
|
||||||
@@ -73,6 +74,15 @@ static void downloader_free ( struct refcnt *refcnt ) {
|
|||||||
*/
|
*/
|
||||||
static void downloader_finished ( struct downloader *downloader, int rc ) {
|
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 */
|
/* Shut down interfaces */
|
||||||
intf_shutdown ( &downloader->xfer, rc );
|
intf_shutdown ( &downloader->xfer, rc );
|
||||||
intf_shutdown ( &downloader->job, rc );
|
intf_shutdown ( &downloader->job, rc );
|
||||||
|
|||||||
Reference in New Issue
Block a user