commit 8fb28857d5fcaa50bcf3494613f8089d14e569b9
parent 936c6b69ad878ad5c51fc35ea5be3f06babf58f1
Author: sin <sin@2f30.org>
Date: Sat, 16 Nov 2013 17:52:47 +0000
Use sigaction() instead of signal()
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/rs.c b/rs.c
@@ -122,6 +122,7 @@ main(int argc, char *argv[])
int baudrate = 115200;
int dev = 0;
int ret;
+ struct sigaction sa;
struct ftdi_device_list *iter;
int vendor = 0x0403;
int product = 0x6001;
@@ -191,7 +192,11 @@ main(int argc, char *argv[])
printf("Break key is set to ^\\\n");
- signal(SIGQUIT, interrupt);
+ sa.sa_handler = interrupt;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = SA_RESTART;
+ sigaction(SIGQUIT, &sa, NULL);
+
ttyinit();
loop();
ttyrestore();