From a5ce726a8aa95758203d24a255bb4b5d4bfecef0 Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Mon, 22 Apr 2024 15:17:46 +0100 Subject: [PATCH] return LIBAVRDUDE_EXIT instead of exit(0) --- src/libavrdude.h | 1 + src/stk500v2.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libavrdude.h b/src/libavrdude.h index 453b22a0..60cf4ebf 100644 --- a/src/libavrdude.h +++ b/src/libavrdude.h @@ -59,6 +59,7 @@ typedef uint32_t pinmask_t; #define LIBAVRDUDE_NOTSUPPORTED (-2) // operation not supported #define LIBAVRDUDE_SOFTFAIL (-3) // returned, eg, by avr_signature() if caller // might proceed with chip erase +#define LIBAVRDUDE_EXIT (-4) // End all operations in this session /* formerly lists.h */ diff --git a/src/stk500v2.c b/src/stk500v2.c index b923666c..926076a8 100644 --- a/src/stk500v2.c +++ b/src/stk500v2.c @@ -1913,7 +1913,7 @@ static int stk500v2_parseextparms(const PROGRAMMER *pgm, const LISTID extparms) } msg_error(" -xxtal=[M|k] Set programmer xtal frequency\n"); msg_error(" -xhelp Show this help menu and exit\n"); - exit(0); + return LIBAVRDUDE_EXIT;; } pmsg_error("invalid extended parameter %s\n", extended_param); @@ -2048,7 +2048,7 @@ static int stk500v2_jtag3_parseextparms(const PROGRAMMER *pgm, const LISTID extp if(str_starts(pgmid, "pickit4") || str_starts(pgmid, "snap")) msg_error(" -xmode=avr|pic Set programmer to AVR or PIC mode, then exit\n"); msg_error (" -xhelp Show this help menu and exit\n"); - exit(0); + return LIBAVRDUDE_EXIT;; } pmsg_error("invalid extended parameter %s\n", extended_param);