summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Ben Wagner2020-02-11 15:38:21 -0500
committerGravatar Nikias Bassen2022-03-29 12:13:38 +0200
commitabba1e82679a58a32a943cded58204d14a231ef6 (patch)
tree8d4f216631966c173b85f63f2d98d996f2518be4 /tools
parent468de4021cff4005211bb0a440f8caeecbc723e7 (diff)
downloadlibimobiledevice-abba1e82679a58a32a943cded58204d14a231ef6.tar.gz
libimobiledevice-abba1e82679a58a32a943cded58204d14a231ef6.tar.bz2
More fixes
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicedebug.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c
index c596213..ae6dd02 100644
--- a/tools/idevicedebug.c
+++ b/tools/idevicedebug.c
@@ -61,7 +61,7 @@ static void on_signal(int sig)
quit_flag++;
}
-static void cancel_receive()
+static int cancel_receive()
{
return quit_flag;
}
@@ -130,9 +130,11 @@ static debugserver_error_t debugserver_client_handle_response(debugserver_client
} else if (r[0] == 'T') {
/* thread stopped information */
log_debug("Thread stopped. Details:\n%s", r + 1);
- /* "Thread stopped" seems to happen when assert() fails. Use bash convention where signals cause an exit status of 128 + signal */
- *exit_status = 128 + SIGABRT;
- /* Break out of the loop. */
+ if (exit_status != NULL) {
+ /* "Thread stopped" seems to happen when assert() fails. Use bash convention where signals cause an exit status of 128 + signal */
+ *exit_status = 128 + SIGABRT;
+ }
+ /* Break out of the loop. */
dres = DEBUGSERVER_E_UNKNOWN_ERROR;
} else if (r[0] == 'E') {
printf("ERROR: %s\n", r + 1);
@@ -141,8 +143,10 @@ static debugserver_error_t debugserver_client_handle_response(debugserver_client
debugserver_decode_string(r + 1, strlen(r) - 1, &o);
if (o != NULL) {
printf("Exit %s: %u\n", (r[0] == 'W' ? "status" : "due to signal"), o[0]);
+ if (exit_status != NULL) {
/* Use bash convention where signals cause an exit status of 128 + signal */
*exit_status = o[0] + (r[0] == 'W' ? 0 : 128);
+ }
} else {
debug_info("Unable to decode exit status from %s", r);
dres = DEBUGSERVER_E_UNKNOWN_ERROR;