summaryrefslogtreecommitdiffstats
path: root/src/core/downloader.c
diff options
context:
space:
mode:
authorMichael Brown2013-11-01 16:05:16 +0100
committerMichael Brown2013-11-01 17:17:28 +0100
commit5674a3c087bf1bde65b61b6b0ca26035dd47baa3 (patch)
treee30dd88a260b22c9bf3919432e645544d1867294 /src/core/downloader.c
parent[interface] Default to calling intf_restart() in response to intf_close() (diff)
downloadipxe-5674a3c087bf1bde65b61b6b0ca26035dd47baa3.tar.gz
ipxe-5674a3c087bf1bde65b61b6b0ca26035dd47baa3.tar.xz
ipxe-5674a3c087bf1bde65b61b6b0ca26035dd47baa3.zip
[job] Allow job_progress() to return an ongoing job status code, if known
Some background jobs have a meaningful ongoing status code (e.g. the current link status for a job waiting for a network link to come up). Allow this to be exposed via the job_progress() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/downloader.c')
-rw-r--r--src/core/downloader.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/downloader.c b/src/core/downloader.c
index 4f3fc2c8..3927dfab 100644
--- a/src/core/downloader.c
+++ b/src/core/downloader.c
@@ -131,9 +131,10 @@ static int downloader_ensure_size ( struct downloader *downloader,
*
* @v downloader Downloader
* @v progress Progress report to fill in
+ * @ret ongoing_rc Ongoing job status code (if known)
*/
-static void downloader_progress ( struct downloader *downloader,
- struct job_progress *progress ) {
+static int downloader_progress ( struct downloader *downloader,
+ struct job_progress *progress ) {
/* This is not entirely accurate, since downloaded data may
* arrive out of order (e.g. with multicast protocols), but
@@ -141,6 +142,8 @@ static void downloader_progress ( struct downloader *downloader,
*/
progress->completed = downloader->pos;
progress->total = downloader->image->len;
+
+ return 0;
}
/****************************************************************************