From 84f86bf023000bab0245ad43204a409eab734b07 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 27 Feb 2018 00:39:31 +0100 Subject: [PATCH] Add TD3 exo4 correction. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- TD3/exo4/exo4.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TD3/exo4/exo4.c b/TD3/exo4/exo4.c index e835d0d..717a9d7 100644 --- a/TD3/exo4/exo4.c +++ b/TD3/exo4/exo4.c @@ -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() -- 2.34.1