All pastes #342828 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-02-06 16:06 UTC
rendered paste body
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<waittime); i++)
   sleep(1);