diff --git a/src/exec_checkra1n.c b/src/exec_checkra1n.c index f52bf3e..60686bd 100644 --- a/src/exec_checkra1n.c +++ b/src/exec_checkra1n.c @@ -152,13 +152,6 @@ checkra1n_exec: {}; NULL }, environ); } - - waitpid(pid, NULL, 0); - if (!external_pongo && pongo_path != NULL) { - unlink(pongo_path); - } - if (pongo_path != NULL) free(pongo_path); - pongo_path = NULL; if (ret) { LOG(LOG_FATAL, "Cannot posix spawn %s: %d (%s)", checkra1n_path, errno, strerror(errno)); if (ext_checkra1n != NULL) unlink(checkra1n_path); @@ -171,6 +164,12 @@ checkra1n_exec: {}; free(checkra1n_path); checkra1n_path = NULL; } + waitpid(pid, NULL, 0); + if (!external_pongo && pongo_path != NULL) { + unlink(pongo_path); + } + if (pongo_path != NULL) free(pongo_path); + pongo_path = NULL; #if defined(__APPLE__) && defined(__arm64__) && (TARGET_OS_IPHONE || defined(FORCE_HELPER)) if (libcheckra1nhelper_dylib_path != NULL) { unlink(libcheckra1nhelper_dylib_path); diff --git a/src/optparse.c b/src/optparse.c index 6c4faf6..135cee1 100644 --- a/src/optparse.c +++ b/src/optparse.c @@ -364,8 +364,10 @@ int optparse(int argc, char* argv[]) { } } if (verbose >= 2) setenv("LIBUSB_DEBUG", "1", 1); + if (verbose >= 3) { + libusbmuxd_set_debug_level(verbose - 2); irecv_set_debug_level(1); setenv("LIBUSB_DEBUG", "2", 1); }