Pongthep Kulkrisada a écrit :
* BERTRAND Jol (joel.bertrand%systella.fr@localhost) wrote:volatile int flag; flag = 0; do { code_retour = nanosleep(&temporisation,&temporisation); erreur = errno; if (flag == 1) { exit(0); } } while((code_retour == -1)&& (erreur == EINTR)); SIGINT signal handler is : void interruption1(int signal) { flag = 1; return; }I'm not sure what you are expecting to test. But the code should look like the attached main.c. Testing flag is redundant anyway.
No, testing flag isn't redundant as I have to catch SIGINT and SIGUSR1. I have written a simple test to see what's happening with only one signal.
Regards, JKB