Stefan Reinauer has uploaded this change for review. ( https://review.coreboot.org/c/em100/+/47842 )
Change subject: Rename do_exit_flag to exit_requested ......................................................................
Rename do_exit_flag to exit_requested
... and change the type to sig_atomic_t. Also, make it globally available again (because it is indeed useful in other parts of the code)
Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org Change-Id: Ifd6f0d9145c689ecce0609a2d04b2221f8533181 --- M em100.c M em100.h 2 files changed, 5 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/42/47842/1
diff --git a/em100.c b/em100.c index 2866f91..d66b89e 100644 --- a/em100.c +++ b/em100.c @@ -29,12 +29,12 @@ char *database_version; int debug = 0;
-static volatile int do_exit_flag = 0; +volatile int exit_requested = 0; static struct em100 em100_state;
static void exit_handler(int sig __unused) { - do_exit_flag = 1; + exit_requested = 1; }
struct em100_hold_pin_states { @@ -1214,7 +1214,7 @@
printf(". Press CTL-C to exit.\n\n");
- while (!do_exit_flag && usb_errors < 10) { + while (!exit_requested && usb_errors < 10) { if (trace) { if (!read_spi_trace(em100, terminal, address_offset)) diff --git a/em100.h b/em100.h index b003bd6..d49339b 100644 --- a/em100.h +++ b/em100.h @@ -15,6 +15,7 @@ #define __EM100_H__
#include <libusb.h> +#include <signal.h>
#define __unused __attribute__((unused)) #define __packed __attribute__((packed)) @@ -196,6 +197,7 @@ #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) char *get_em100_file(const char *name); extern int debug; +extern volatile sig_atomic_t exit_requested;
/* Chips */ int parse_dcfg(chipdesc *chip, TFILE *dcfg);