*
* @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
*/
progress->completed = downloader->pos;
progress->total = downloader->image->len;
+
+ return 0;
}
/****************************************************************************
*
* @v intf Object interface
* @v progress Progress data to fill in
+ * @ret ongoing_rc Ongoing job status code (if known)
*/
-void job_progress ( struct interface *intf, struct job_progress *progress ) {
+int job_progress ( struct interface *intf, struct job_progress *progress ) {
struct interface *dest;
job_progress_TYPE ( void * ) *op =
intf_get_dest_op ( intf, job_progress, &dest );
void *object = intf_object ( dest );
+ int ongoing_rc;
DBGC ( INTF_COL ( intf ), "INTF " INTF_INTF_FMT " job_progress\n",
INTF_INTF_DBG ( intf, dest ) );
+ /* Initialise progress to zero */
+ memset ( progress, 0, sizeof ( *progress ) );
+
if ( op ) {
- op ( object, progress );
+ ongoing_rc = op ( object, progress );
} else {
- /* Default is to mark progress as zero */
- memset ( progress, 0, sizeof ( *progress ) );
+ /* Default is to leave progress as zero and have no
+ * known return status code.
+ */
+ ongoing_rc = 0;
}
intf_put ( dest );
+ return ongoing_rc;
}
unsigned long total;
};
-extern void job_progress ( struct interface *intf,
- struct job_progress *progress );
+extern int job_progress ( struct interface *intf,
+ struct job_progress *progress );
#define job_progress_TYPE( object_type ) \
- typeof ( void ( object_type, struct job_progress *progress ) )
+ typeof ( int ( object_type, struct job_progress *progress ) )
#endif /* _IPXE_JOB_H */