summaryrefslogtreecommitdiffstats
path: root/src/image
diff options
context:
space:
mode:
Diffstat (limited to 'src/image')
-rw-r--r--src/image/script.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/image/script.c b/src/image/script.c
index f9d5a3939..1c3ff82e2 100644
--- a/src/image/script.c
+++ b/src/image/script.c
@@ -34,6 +34,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/command.h>
#include <ipxe/parseopt.h>
#include <ipxe/image.h>
+#include <ipxe/shell.h>
struct image_type script_image_type __image_type ( PROBE_NORMAL );
@@ -106,13 +107,8 @@ static int process_script ( int ( * process_line ) ( const char *line ),
*/
static int terminate_on_exit_or_failure ( int rc ) {
- /* Check and consume exit flag */
- if ( shell_exit ) {
- shell_exit = 0;
- return 1;
- }
-
- return ( rc != 0 );
+ return ( shell_stopped ( SHELL_STOP_COMMAND_SEQUENCE ) ||
+ ( rc != 0 ) );
}
/**
@@ -292,6 +288,9 @@ static int goto_exec ( int argc, char **argv ) {
return rc;
}
+ /* Terminate processing of current command */
+ shell_stop ( SHELL_STOP_COMMAND );
+
return 0;
}