Add TD3 exo4 correction.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 26 Feb 2018 23:39:31 +0000 (00:39 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 26 Feb 2018 23:39:31 +0000 (00:39 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
TD3/exo4/exo4.c

index e835d0d44505cf72cfdb4acff9d5f8b13d379417..717a9d7a29ae176fb045211b2e354ad0025d6ec0 100644 (file)
@@ -6,14 +6,20 @@
 
 void sigintP()
 {
+       printf("pid=%d\n", getpid());
+       signal(SIGINT, sigintP);
 }
 
 void sigalrm()
 {
+       exit(1);
 }
 
 void sigintF()
 {
+       signal(SIGINT, SIG_IGN);
+       signal(SIGALRM, sigalrm);
+       alarm(5);
 }
 
 void sigchld()