changeset 229:96332d875fc9

loadtools: preparations for loadtool exit code possibly being nonzero
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 03 Aug 2017 01:33:06 +0000
parents ccf5edab9d5f
children a91dc7157544
files loadtools/bpmain.c loadtools/ltexit.c loadtools/ltmain.c
diffstat 3 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/loadtools/bpmain.c	Thu Aug 03 01:25:40 2017 +0000
+++ b/loadtools/bpmain.c	Thu Aug 03 01:33:06 2017 +0000
@@ -87,7 +87,7 @@
 			fflush(stdout);
 		}
 		if (!fgets(command, sizeof command, stdin))
-			default_exit();
+			default_exit(0);
 		buzplay_dispatch_cmd(command);
 	}
 }
--- a/loadtools/ltexit.c	Thu Aug 03 01:25:40 2017 +0000
+++ b/loadtools/ltexit.c	Thu Aug 03 01:33:06 2017 +0000
@@ -9,38 +9,38 @@
 #include <stdlib.h>
 
 static void
-exit_bare()
+exit_bare(rc)
 {
-	exit(0);
+	exit(rc);
 }
 
 static void
-exit_gta02_cutpwr()
+exit_gta02_cutpwr(rc)
 {
 #ifdef GTA0x_AP_BUILD
 	set_gta_modem_power_ctrl(0);
 #endif
-	exit(0);
+	exit(rc);
 }
 
 static void
-exit_iotaoff()
+exit_iotaoff(rc)
 {
 	static char *poweroff_argv[2] = {"poweroff", 0};
 
 	tpinterf_make_cmd(poweroff_argv);
 	tpinterf_send_cmd();
-	exit(0);
+	exit(rc);
 }
 
 static void
-exit_jump0()
+exit_jump0(rc)
 {
 	static char *jump0_argv[3] = {"jump", "0", 0};
 
 	tpinterf_make_cmd(jump0_argv);
 	tpinterf_send_cmd();
-	exit(0);
+	exit(rc);
 }
 
 void (*default_exit)() = exit_bare;
@@ -62,7 +62,7 @@
 	struct kwtab *tp;
 
 	if (argc < 2)
-		default_exit();
+		default_exit(0);
 	for (tp = exit_modes; tp->kw; tp++)
 		if (!strcmp(tp->kw, argv[1]))
 			break;
@@ -72,7 +72,7 @@
 			argv[1]);
 		return(-1);
 	}
-	tp->func();
+	tp->func(0);
 }
 
 /* called from hwparam.c config file parser */
--- a/loadtools/ltmain.c	Thu Aug 03 01:25:40 2017 +0000
+++ b/loadtools/ltmain.c	Thu Aug 03 01:33:06 2017 +0000
@@ -92,7 +92,7 @@
 			fflush(stdout);
 		}
 		if (!fgets(command, sizeof command, stdin))
-			default_exit();
+			default_exit(0);
 		loadtool_dispatch_cmd(command, 0);
 	}
 }