At 12:43 AM 12/4/2004 -0500, Christopher Faylor wrote: > >I wrote a simple test case to check this and I don't see it -- on XP. I >can't easily run Me anymore. Does the attached program demonstrate this >behavior when you run it? It should re-exec itself every time you hit >CTRL-C.
That test case has no problem, but the attached one does. Use kill -30 pid Pierre
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/signal.h> void ouch (int sig) { printf ("got signal %d\n", sig); return; } int main (int argc, char **argv) { if (getppid() != 1 && fork()) exit(0); signal (SIGUSR1, ouch); while (pause ()) { puts ("execing myself"); execv (argv[0], argv); } exit (0); }