diff options
| author | Holger Lubitz | 2007-08-05 19:02:54 +0200 |
|---|---|---|
| committer | Holger Lubitz | 2007-08-05 19:02:54 +0200 |
| commit | 4f668796537a5a05f44ebfe9f69bb2657650c52f (patch) | |
| tree | d44d2713e593cb46aa0655bc583edd0b4d952362 /src/core | |
| parent | malloc attribute changes (diff) | |
| parent | Display name and status of each file as it is downloaded. (diff) | |
| download | ipxe-4f668796537a5a05f44ebfe9f69bb2657650c52f.tar.gz ipxe-4f668796537a5a05f44ebfe9f69bb2657650c52f.tar.xz ipxe-4f668796537a5a05f44ebfe9f69bb2657650c52f.zip | |
Merge branch 'master' of git://git.etherboot.org/scm/gpxe
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/monojob.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/core/monojob.c b/src/core/monojob.c index b4042a3d3..ea9bc8348 100644 --- a/src/core/monojob.c +++ b/src/core/monojob.c @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <string.h> +#include <stdio.h> #include <errno.h> #include <gpxe/process.h> #include <console.h> @@ -54,11 +56,14 @@ struct job_interface monojob = { /** * Wait for single foreground job to complete * + * @v string Job description to display * @ret rc Job final status code */ -int monojob_wait ( void ) { +int monojob_wait ( const char *string ) { int key; + int rc; + printf ( "%s... ", string ); monojob_rc = -EINPROGRESS; while ( monojob_rc == -EINPROGRESS ) { step(); @@ -67,12 +72,20 @@ int monojob_wait ( void ) { switch ( key ) { case CTRL_C: job_kill ( &monojob ); - return -ECANCELED; - break; + rc = -ECANCELED; + goto done; default: break; } } } - return monojob_rc; + rc = monojob_rc; + +done: + if ( rc ) { + printf ( "%s\n", strerror ( rc ) ); + } else { + printf ( "ok\n" ); + } + return rc; } |
