Clean exit of serialdump when hitting Ctrl-C
Ctrl-C is the best way to close serialdump after using make login. With a clean exit it will signal to make that the make run was successful.
This commit is contained in:
parent
9e080e8aa5
commit
d524211c2a
1 changed files with 9 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
|
||||
#define BAUDRATE B115200
|
||||
#define BAUDRATE_S "115200"
|
||||
|
@ -82,9 +83,17 @@ print_hex_line(char *prefix, unsigned char *outbuf, int index)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
intHandler(int sig)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
signal(SIGINT, intHandler);
|
||||
|
||||
struct termios options;
|
||||
fd_set mask, smask;
|
||||
int fd;
|
||||
|
|
Loading…
Reference in a new issue