X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TD3%2Fexo4%2Fexo4.c;h=a5ffce32ae087b31a072c73737d8a97e2037e9e1;hb=151a0f5636afe11afad9428f737e71372a4c24e4;hp=717a9d7a29ae176fb045211b2e354ad0025d6ec0;hpb=84f86bf023000bab0245ad43204a409eab734b07;p=TD_SE.git diff --git a/TD3/exo4/exo4.c b/TD3/exo4/exo4.c index 717a9d7..a5ffce3 100644 --- a/TD3/exo4/exo4.c +++ b/TD3/exo4/exo4.c @@ -4,25 +4,25 @@ #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; }