From e31ee8dda8f7acfd185f28ec663a4d7a93bfd04c Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Thu, 4 Jun 2020 03:17:44 +0200 Subject: Use defined exit codes for return codes in idevicediagnostics --- tools/idevicediagnostics.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/idevicediagnostics.c b/tools/idevicediagnostics.c index a23ff8b..052bbed 100644 --- a/tools/idevicediagnostics.c +++ b/tools/idevicediagnostics.c @@ -66,7 +66,7 @@ int main(int argc, char **argv) diagnostics_relay_client_t diagnostics_client = NULL; lockdownd_error_t ret = LOCKDOWN_E_UNKNOWN_ERROR; lockdownd_service_descriptor_t service = NULL; - int result = -1; + int result = EXIT_FAILURE; int i; const char *udid = NULL; int cmd = CMD_NONE; @@ -87,7 +87,7 @@ int main(int argc, char **argv) i++; if (!argv[i] || !*argv[i]) { print_usage(argc, argv); - result = 0; + result = EXIT_SUCCESS; goto cleanup; } udid = argv[i]; @@ -95,7 +95,7 @@ int main(int argc, char **argv) } else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { print_usage(argc, argv); - result = 0; + result = EXIT_SUCCESS; goto cleanup; } else if (!strcmp(argv[i], "sleep")) { @@ -174,7 +174,7 @@ int main(int argc, char **argv) } else { print_usage(argc, argv); - return 0; + return EXIT_SUCCESS; } } @@ -208,7 +208,7 @@ int main(int argc, char **argv) lockdownd_client_free(lockdown_client); - result = -1; + result = EXIT_FAILURE; if ((ret == LOCKDOWN_E_SUCCESS) && service && (service->port > 0)) { if (diagnostics_relay_client_new(device, service, &diagnostics_client) != DIAGNOSTICS_RELAY_E_SUCCESS) { -- cgit v1.1-32-gdbae