summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMichael Brown2015-08-21 16:41:35 +0200
committerMichael Brown2015-08-21 16:46:28 +0200
commitf58ebbdfb5f48089bb3df088654d5bf735dab2c2 (patch)
treef8b476c798df160482773c9d6ac68eb8f02c88e4 /src/core/main.c
parent[pxe] Warn about PXE NBPs that may be EFI executables (diff)
downloadipxe-f58ebbdfb5f48089bb3df088654d5bf735dab2c2.tar.gz
ipxe-f58ebbdfb5f48089bb3df088654d5bf735dab2c2.tar.xz
ipxe-f58ebbdfb5f48089bb3df088654d5bf735dab2c2.zip
[test] Allow self-tests to report exit status when running under Linux
Allow the return status from an embedded image to propagate out to the eventual return status from main(). When running under Linux, this allows the pass/fail result of unit tests to be observable without having to visually inspect the console output. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 97394d71..638dea9c 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
* @ret rc Return status code
*/
__asmcall int main ( void ) {
+ int rc;
/* Perform one-time-only initialisation (e.g. heap) */
initialise();
@@ -35,9 +36,11 @@ __asmcall int main ( void ) {
startup();
printf ( "ok\n" );
- ipxe ( NULL );
+ /* Attempt to boot */
+ if ( ( rc = ipxe ( NULL ) ) != 0 )
+ goto err_ipxe;
+ err_ipxe:
shutdown_exit();
-
- return 0;
+ return rc;
}