From 71c1674e20d3b8a0466bc242abc9db27e858db6d Mon Sep 17 00:00:00 2001 From: Nick Chan Date: Wed, 18 Jan 2023 01:53:24 +0800 Subject: [PATCH] nicer libirecovery errors --- src/devhelper.c | 8 ++++---- src/dfuhelper.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/devhelper.c b/src/devhelper.c index 3509969..962f902 100644 --- a/src/devhelper.c +++ b/src/devhelper.c @@ -346,7 +346,7 @@ int recvinfo_cmd(recvinfo_t* info, const uint64_t ecid) { irecv_client_t client = NULL; irecv_error_t err = irecv_open_with_ecid(&client, ecid); if (err != IRECV_E_SUCCESS) { - LOG(LOG_ERROR, "libirecovery error: %d\n", err); + LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err)); return -1; } int mode = 0; @@ -356,7 +356,7 @@ int recvinfo_cmd(recvinfo_t* info, const uint64_t ecid) { irecv_device_t device; err = irecv_devices_get_device_by_client(client, &device); if (err != IRECV_E_SUCCESS) { - LOG(LOG_ERROR, "libirecovery error: %d\n", err); + LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err)); return -1; } info->mode = mode; @@ -378,7 +378,7 @@ int autoboot_cmd(const uint64_t ecid) { irecv_close(client); return 0; } else { - LOG(LOG_ERROR, "libirecovery error: %d\n", err); + LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err)); return -1; } } @@ -393,7 +393,7 @@ int exitrecv_cmd(const uint64_t ecid) { irecv_close(client); return 0; } else { - LOG(LOG_ERROR, "libirecovery error: %d\n", err); + LOG(LOG_ERROR, "libirecovery error: %d (%s)", err, irecv_strerror(err)); return -1; } } diff --git a/src/dfuhelper.c b/src/dfuhelper.c index 4cd1171..f5959db 100644 --- a/src/dfuhelper.c +++ b/src/dfuhelper.c @@ -90,7 +90,7 @@ void* connected_recovery_mode(struct irecv_device_info* info) { LOG(LOG_WARNING, "Ignoring non-arm64 device..."); return NULL; } - + sleep(1); ret = autoboot_cmd(info->ecid); if (ret) { LOG(LOG_ERROR, "Cannot set auto-boot back to true");