refactor: remove positive error codes

This commit is contained in:
douniwan5788 2024-09-02 22:30:44 +08:00
commit 970c2d0999
3 changed files with 2 additions and 11 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_SQUIT; return PM3_EFATAL;
} }
static int CmdRev(const char *Cmd) { static int CmdRev(const char *Cmd) {

View file

@ -574,11 +574,6 @@ 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

@ -794,11 +794,7 @@ typedef struct {
#define FLAG_ANSI 0x08 #define FLAG_ANSI 0x08
// Error codes Usages: // Error codes Usages:
// NOTE: Positive values should be reserved for commands in case they need to return multiple statuses and error codes simultaneously.
// Success, regular quit
#define PM3_SQUIT 2
// Success, transfer nonces pm3: Sending nonces back to client
#define PM3_SNONCES 1
// Success (no error) // Success (no error)
#define PM3_SUCCESS 0 #define PM3_SUCCESS 0