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);
CLIParserFree(ctx);
return PM3_EFATAL;
return PM3_SQUIT;
}
static int CmdRev(const char *Cmd) {

View file

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

View file

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