nfc-emulate-uid: remove unreachable code and add proper cleaning when interrupted

This commit is contained in:
Philippe Teuwen 2014-03-04 01:41:01 +01:00
parent db4fae9c2c
commit 6ab3c368b8

View file

@ -79,7 +79,10 @@ intr_hdlr(int sig)
if (pnd != NULL) { if (pnd != NULL) {
printf("\nAborting current command...\n"); printf("\nAborting current command...\n");
nfc_abort_command(pnd); nfc_abort_command(pnd);
nfc_close(pnd);
} }
nfc_exit(context);
exit(EXIT_SUCCESS);
} }
static void static void
@ -237,7 +240,4 @@ main(int argc, char *argv[])
} }
} }
} }
nfc_close(pnd);
nfc_exit(context);
exit(EXIT_SUCCESS);
} }