Bläddra i källkod

[downloader] Log final status of all downloads

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 år sedan
förälder
incheckning
5a91f5646a
1 ändrade filer med 10 tillägg och 0 borttagningar
  1. 10
    0
      src/core/downloader.c

+ 10
- 0
src/core/downloader.c Visa fil

@@ -21,6 +21,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
21 21
 #include <stdlib.h>
22 22
 #include <stdarg.h>
23 23
 #include <errno.h>
24
+#include <syslog.h>
24 25
 #include <ipxe/iobuf.h>
25 26
 #include <ipxe/xfer.h>
26 27
 #include <ipxe/open.h>
@@ -73,6 +74,15 @@ static void downloader_free ( struct refcnt *refcnt ) {
73 74
  */
74 75
 static void downloader_finished ( struct downloader *downloader, int rc ) {
75 76
 
77
+	/* Log download status */
78
+	if ( rc == 0 ) {
79
+		syslog ( LOG_NOTICE, "Downloaded \"%s\"\n",
80
+			 downloader->image->name );
81
+	} else {
82
+		syslog ( LOG_ERR, "Download of \"%s\" failed: %s\n",
83
+			 downloader->image->name, strerror ( rc ) );
84
+	}
85
+
76 86
 	/* Shut down interfaces */
77 87
 	intf_shutdown ( &downloader->xfer, rc );
78 88
 	intf_shutdown ( &downloader->job, rc );

Laddar…
Avbryt
Spara