examples/utils: add nfc_exit() to signal traps
and one missing nfc_abort_command()
This commit is contained in:
parent
73b5c9d0af
commit
e55efd6db0
7 changed files with 23 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue