mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-02-26 19:56:39 +00:00
examples/utils: add nfc_exit() to signal traps
and one missing nfc_abort_command()
This commit is contained in:
@@ -237,10 +237,12 @@ nfcforum_tag4_io(struct nfc_emulator *emulator, const uint8_t *data_in, const si
|
||||
static void stop_emulation(int sig)
|
||||
{
|
||||
(void) sig;
|
||||
if (pnd != NULL)
|
||||
if (pnd != NULL) {
|
||||
nfc_abort_command(pnd);
|
||||
else
|
||||
} else {
|
||||
nfc_exit(context);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -72,10 +72,12 @@ print_usage(char *progname)
|
||||
static void stop_select(int sig)
|
||||
{
|
||||
(void) sig;
|
||||
if (pnd != NULL)
|
||||
if (pnd != NULL) {
|
||||
nfc_abort_command(pnd);
|
||||
else
|
||||
} else {
|
||||
nfc_exit(context);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user