pim@ele.tue.nl (Pim Buurman) (10/16/90)
I have found a rather simple way to create very persistent programs. I have a large program to simulate electronic circuits. When an error or interrupt is caught, the results are saved. However, when during this saving another signal is caught, nothing happens, but the programs starts running. Only shutting can resolve this. What is the problem ? This is the code I use: main() { signal(SIGINT , interrupt); signal(SIGQUIT, interrupt); signal(SIGFPE , interrupt); /* Start a long calculation */ } static int interrupt( sig ) int sig; { switch( sig ) { case SIGINT: error("Signal SIGINT caught!\n"); break; case SIGQUIT: error("Signal SIGQUIT caught!\n"); break; case SIGFPE: error("Signal SIGFPE caught!\n"); break; } /* Saving results until now, so we can maybe find the problem */ exit(1); } Thank you. Pim. -- Pim Buurman, Phone: +(31)40-473238 Eindhoven University of Technology, Dept. of Electr. Eng. (ES/EH 7.24) P.O. Box 513, 5600 MB Eindhoven, The Netherlands Email: pim@ele.tue.nl