|
@@ -34,22 +34,30 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
34
|
34
|
*
|
35
|
35
|
* @v intf Object interface
|
36
|
36
|
* @v progress Progress data to fill in
|
|
37
|
+ * @ret ongoing_rc Ongoing job status code (if known)
|
37
|
38
|
*/
|
38
|
|
-void job_progress ( struct interface *intf, struct job_progress *progress ) {
|
|
39
|
+int job_progress ( struct interface *intf, struct job_progress *progress ) {
|
39
|
40
|
struct interface *dest;
|
40
|
41
|
job_progress_TYPE ( void * ) *op =
|
41
|
42
|
intf_get_dest_op ( intf, job_progress, &dest );
|
42
|
43
|
void *object = intf_object ( dest );
|
|
44
|
+ int ongoing_rc;
|
43
|
45
|
|
44
|
46
|
DBGC ( INTF_COL ( intf ), "INTF " INTF_INTF_FMT " job_progress\n",
|
45
|
47
|
INTF_INTF_DBG ( intf, dest ) );
|
46
|
48
|
|
|
49
|
+ /* Initialise progress to zero */
|
|
50
|
+ memset ( progress, 0, sizeof ( *progress ) );
|
|
51
|
+
|
47
|
52
|
if ( op ) {
|
48
|
|
- op ( object, progress );
|
|
53
|
+ ongoing_rc = op ( object, progress );
|
49
|
54
|
} else {
|
50
|
|
- /* Default is to mark progress as zero */
|
51
|
|
- memset ( progress, 0, sizeof ( *progress ) );
|
|
55
|
+ /* Default is to leave progress as zero and have no
|
|
56
|
+ * known return status code.
|
|
57
|
+ */
|
|
58
|
+ ongoing_rc = 0;
|
52
|
59
|
}
|
53
|
60
|
|
54
|
61
|
intf_put ( dest );
|
|
62
|
+ return ongoing_rc;
|
55
|
63
|
}
|