Timer signal results in "Alarm clock"



Hello,

I'd like to connect the timer signal SIGALRM to a signal handler

  signal (SIGALRM, timer_signal_handler);

and start the timer

  itimerval t;
  t.it_value.tv_sec=1;
  t.it_value.tv_usec=0;
  setitimer (ITIMER_REAL, &t, NULL);

All this works fine if I start the timer before I call gtk_main () and
the timer_signal_handler function gets called as usual. But if I setup
the timer after gtk_main (), the program stops after the adjusted time
with the message "Alarm clock".

Now, I really would like to avoid this message and the stopping of my
program, as well. I need to react myself within timer_signal_handler.

I'm sure, there exists a solution ;) Have anyone a good idea?

Thanks a lot.


-- 
 _____  _   _  _____
(  _  )( ) ( )(  _  )                       PENGUINS ARE COOL
| (_) || |/'/ | (_) |
|  _  || , <  |  _  | ---------------------------------------
| | | || |\ \ | | | | andre.karwath@informatik.tu-chemnitz.de
(_) (_)(_) (_)(_) (_)          http://www.tu-chemnitz.de/~aka



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]