static void sig_handler_capture_now (int sig_num) { signal (SIGUSR1, sig_handler_capture_now); capture_now = 1; } ... capture_now = 0; signal(SIGUSR1, sig_handler_capture_now); /* I have to wait until next_pic_time OR when I receive the SIGUSR1 signal */ waittime = next_pic_time - time (NULL); for (i=0; (!capture_now) && (i