From 8e29559db66c9fef6d17c41fa0f9506e5a97f00f Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 16 Jan 2022 19:05:47 +0100 Subject: [PATCH] client: return error code --- client/src/proxmark3.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/proxmark3.c b/client/src/proxmark3.c index 43649d22e..18eba4a2d 100644 --- a/client/src/proxmark3.c +++ b/client/src/proxmark3.c @@ -44,6 +44,8 @@ typedef enum LogoMode { UTF8, ANSI, ASCII } LogoMode; +static int mainret = PM3_ESOFT; + static void showBanner_logo(LogoMode mode) { switch (mode) { case UTF8: { @@ -398,12 +400,12 @@ check_script: } // process cmd g_pendingPrompt = false; - int ret = CommandReceived(cmd); + mainret = CommandReceived(cmd); #if defined ICOPYX PrintAndLogEx(NORMAL, "\nNikola.D: %d", ret); #endif // exit or quit - if (ret == PM3_EFATAL) + if (mainret == PM3_EFATAL) break; } free(cmd); @@ -1070,6 +1072,6 @@ int main(int argc, char *argv[]) { if (g_session.window_changed) // Plot/Overlay moved or resized preferences_save(); - exit(EXIT_SUCCESS); + return mainret; } #endif //LIBPM3