- /* set up signal handler */
- ob_main_loop_signal_add(ob_main_loop, SIGUSR1, signal_handler, NULL, NULL);
- ob_main_loop_signal_add(ob_main_loop, SIGUSR2, signal_handler, NULL, NULL);
- ob_main_loop_signal_add(ob_main_loop, SIGTERM, signal_handler, NULL, NULL);
- ob_main_loop_signal_add(ob_main_loop, SIGINT, signal_handler, NULL, NULL);
- ob_main_loop_signal_add(ob_main_loop, SIGHUP, signal_handler, NULL, NULL);
- ob_main_loop_signal_add(ob_main_loop, SIGPIPE, signal_handler, NULL, NULL);
- ob_main_loop_signal_add(ob_main_loop, SIGCHLD, signal_handler, NULL, NULL);
+ /* set up signal handlers, they are called from the mainloop
+ in the main program's thread */
+ obt_signal_add_callback(SIGUSR1, signal_handler, NULL);
+ obt_signal_add_callback(SIGUSR2, signal_handler, NULL);
+ obt_signal_add_callback(SIGTERM, signal_handler, NULL);
+ obt_signal_add_callback(SIGINT, signal_handler, NULL);
+ obt_signal_add_callback(SIGHUP, signal_handler, NULL);
+ obt_signal_add_callback(SIGPIPE, signal_handler, NULL);
+ obt_signal_add_callback(SIGCHLD, signal_handler, NULL);
+ obt_signal_add_callback(SIGTTIN, signal_handler, NULL);
+ obt_signal_add_callback(SIGTTOU, signal_handler, NULL);