Merge pull request #2490 from douniwan5788/fix_exit

fix: exit status
This commit is contained in:
Iceman 2024-09-06 08:53:46 +02:00 committed by GitHub
commit b77099e195
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 3 deletions

View file

@ -283,7 +283,7 @@ static int CmdQuit(const char *Cmd) {
}; };
CLIExecWithReturn(ctx, Cmd, argtable, true); CLIExecWithReturn(ctx, Cmd, argtable, true);
CLIParserFree(ctx); CLIParserFree(ctx);
return PM3_EFATAL; return PM3_SQUIT;
} }
static int CmdRev(const char *Cmd) { static int CmdRev(const char *Cmd) {

View file

@ -44,7 +44,7 @@
#endif #endif
static int mainret = PM3_ESOFT; static int mainret = PM3_SUCCESS;
#ifndef LIBPM3 #ifndef LIBPM3
#define BANNERMSG1 "" #define BANNERMSG1 ""
@ -574,6 +574,11 @@ check_script:
// exit or quit // exit or quit
if (mainret == PM3_EFATAL) if (mainret == PM3_EFATAL)
break; break;
if (mainret == PM3_SQUIT) {
// Normal quit, map to 0
mainret = PM3_SUCCESS;
break;
}
} }
free(cmd); free(cmd);
cmd = NULL; cmd = NULL;

View file

@ -863,7 +863,8 @@ typedef struct {
#define PM3_ENODATA -98 #define PM3_ENODATA -98
// Quit program client: reserved, order to quit the program // Quit program client: reserved, order to quit the program
#define PM3_EFATAL -99 #define PM3_EFATAL -99
// Regular quit
#define PM3_SQUIT -100
// LF // LF
#define LF_FREQ2DIV(f) ((int)(((12000.0 + (f)/2.0)/(f))-1)) #define LF_FREQ2DIV(f) ((int)(((12000.0 + (f)/2.0)/(f))-1))