summaryrefslogtreecommitdiff
path: root/com32/lib/syslinux/run_command.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/syslinux/run_command.c')
-rw-r--r--com32/lib/syslinux/run_command.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/com32/lib/syslinux/run_command.c b/com32/lib/syslinux/run_command.c
index 4693e16d..a0ac9a0d 100644
--- a/com32/lib/syslinux/run_command.c
+++ b/com32/lib/syslinux/run_command.c
@@ -30,18 +30,21 @@
#include <string.h>
#include <com32.h>
-__noreturn syslinux_run_command(const char *command)
+int syslinux_run_command(const char *command)
{
static com32sys_t ireg;
+ char *lm_command = lstrdup(command);
- strcpy(__com32.cs_bounce, command);
-
+ if (!lm_command)
+ return -1;
+
ireg.eax.w[0] = 0x0003;
- ireg.es = SEG(__com32.cs_bounce);
- ireg.ebx.w[0] = OFFS(__com32.cs_bounce);
+ ireg.es = SEG(lm_command);
+ /* ireg.ebx.w[0] = OFFS(lm_command); */
__intcall(0x22, &ireg, NULL);
- /* Should not return even on failure */
- for (;;) ;
+ /* Should not return even on failure, but in case... */
+ lfree(lm_command);
+ return -1;
}