X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TD3%2Fexo4%2Fexo4.c;h=f066e52354d9cd04d1de94cc74b9ba69778aff10;hb=b814550b1a6f6ccf6feb180af4a2f49876c87cff;hp=717a9d7a29ae176fb045211b2e354ad0025d6ec0;hpb=84f86bf023000bab0245ad43204a409eab734b07;p=TD_SE.git diff --git a/TD3/exo4/exo4.c b/TD3/exo4/exo4.c index 717a9d7..f066e52 100644 --- a/TD3/exo4/exo4.c +++ b/TD3/exo4/exo4.c @@ -1,28 +1,28 @@ #include #include -#include +#include #include #include -void sigintP() +static void sigintP() { printf("pid=%d\n", getpid()); signal(SIGINT, sigintP); } -void sigalrm() +static void sigalrm() { exit(1); } -void sigintF() +static void sigintF() { signal(SIGINT, SIG_IGN); signal(SIGALRM, sigalrm); alarm(5); } -void sigchld() +static void sigchld() { int status; wait(&status); @@ -35,14 +35,13 @@ int main(void) if (fork() == 0) { signal(SIGINT, sigintF); while (1) { - printf("ici fils \n"); + printf("ici fils\n"); sleep(1); } } while (1) { signal(SIGINT, sigintP); - printf("ici pere \n"); + printf("ici pere\n"); sleep(1); } - return 0; }