* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: fcron.c,v 1.71 2004-04-29 20:50:47 thib Exp $ */
+ /* $Id: fcron.c,v 1.72 2005-02-26 15:11:32 thib Exp $ */
#include "fcron.h"
#include "socket.h"
#endif
-char rcs_info[] = "$Id: fcron.c,v 1.71 2004-04-29 20:50:47 thib Exp $";
+char rcs_info[] = "$Id: fcron.c,v 1.72 2005-02-26 15:11:32 thib Exp $";
void main_loop(void);
void check_signal(void);
daemon_pid = getpid();
if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
+#ifndef _HPUX_SOURCE
ioctl(fd, TIOCNOTTY, 0);
+#endif
close(fd);
}
explain("%s[%d] " VERSION_QUOTED " started", prog_name, daemon_pid);
+#ifdef _HPUX_SOURCE
+ sigset(SIGTERM, sigterm_handler);
+ sigset(SIGHUP, sighup_handler);
+ sigset(SIGCHLD, sigchild_handler);
+ sigset(SIGUSR1, sigusr1_handler);
+ sigset(SIGUSR2, sigusr2_handler);
+ sigset(SIGPIPE, SIG_IGN);
+#else
signal(SIGTERM, sigterm_handler);
signal(SIGHUP, sighup_handler);
siginterrupt(SIGHUP, 0);
siginterrupt(SIGUSR2, 0);
/* we don't want SIGPIPE to kill fcron, and don't need to handle it */
signal(SIGPIPE, SIG_IGN);
+#endif
/* initialize job database */
next_id = 0;
if (sig_chld > 0) {
wait_chld();
sig_chld = 0;
+#ifndef _HPUX_SOURCE
(void)signal(SIGCHLD, sigchild_handler);
siginterrupt(SIGCHLD, 0);
+#endif
}
if (sig_conf > 0) {
/* update configuration */
synchronize_dir(".");
sig_conf = 0;
+#ifndef _HPUX_SOURCE
signal(SIGHUP, sighup_handler);
siginterrupt(SIGHUP, 0);
+#endif
}
else {
/* reload all configuration */
reload_all(".");
sig_conf = 0;
+#ifndef _HPUX_SOURCE
signal(SIGUSR1, sigusr1_handler);
siginterrupt(SIGUSR1, 0);
+#endif
}
}
debug_opt = (debug_opt > 0)? 0 : 1;
explain("debug_opt = %d", debug_opt);
sig_debug = 0;
+#ifndef _HPUX_SOURCE
signal(SIGUSR2, sigusr2_handler);
siginterrupt(SIGUSR2, 0);
+#endif
}
}