Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Branch tags: u2_10_12_branch
Commit time: 2006-02-16 03:27:03 UTC
Modified files:
Tag: u2_10_12_branch
ircd/ircd.c include/ircd_signal.h ChangeLog
Log message:
Add infrastructure to handle child processes exiting.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.710.2.68 ircu2.10/ChangeLog:1.710.2.69
--- ircu2.10/ChangeLog:1.710.2.68 Wed Feb 15 19:22:28 2006
+++ ircu2.10/ChangeLog Wed Feb 15 19:26:53 2006
@@ -1,5 +1,23 @@
2006-02-15 Michael Poole <[EMAIL PROTECTED]>
+ * include/ircd_signal.h (SigChldCallBack): New typedef.
+ (register_child): Declare.
+ (unregister_child): Declare.
+ (reap_children): Declare.
+
+ * ircd/ircd_signal.c (alloc_crec): New function.
+ (release_crec): New function.
+ (register_child): New function.
+ (do_unregister_child): New function.
+ (unregister_child): New function.
+ (sigchld_callback): New function.
+ (setup_signals): Hook SIGCHLD.
+ (reap_children): New function.
+
+ * ircd/ircd.c (server_restart): Call reap_children() on exit.
+
+2006-02-15 Michael Poole <[EMAIL PROTECTED]>
+
* include/ircd_osdep.h (os_socketpair): Declare.
* ircd/os_generic.c (is_blocked): New local function.
Index: ircu2.10/include/ircd_signal.h
diff -u ircu2.10/include/ircd_signal.h:1.2
ircu2.10/include/ircd_signal.h:1.2.2.1
--- ircu2.10/include/ircd_signal.h:1.2 Mon Oct 4 21:21:37 2004
+++ ircu2.10/include/ircd_signal.h Wed Feb 15 19:26:53 2006
@@ -1,11 +1,16 @@
/** @file ircd_signal.h
* @brief Interface to signal handler subsystem.
- * @version $Id: ircd_signal.h,v 1.2 2004/10/05 04:21:37 entrope Exp $
+ * @version $Id: ircd_signal.h,v 1.2.2.1 2006/02/16 03:26:53 entrope Exp $
*/
#ifndef INCLUDED_ircd_signal_h
#define INCLUDED_ircd_signal_h
+typedef void (*SigChldCallBack)(pid_t child_pid, void *datum, int status);
+
extern void setup_signals(void);
+extern void register_child(pid_t child, SigChldCallBack call, void *datum);
+extern void unregister_child(pid_t child);
+extern void reap_children(void);
#endif /* INCLUDED_ircd_signal_h */
Index: ircu2.10/ircd/ircd.c
diff -u ircu2.10/ircd/ircd.c:1.91.2.1 ircu2.10/ircd/ircd.c:1.91.2.2
--- ircu2.10/ircd/ircd.c:1.91.2.1 Sat Feb 4 16:52:16 2006
+++ ircu2.10/ircd/ircd.c Wed Feb 15 19:26:53 2006
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Entry point and other initialization functions for the daemon.
- * @version $Id: ircd.c,v 1.91.2.1 2006/02/05 00:52:16 entrope Exp $
+ * @version $Id: ircd.c,v 1.91.2.2 2006/02/16 03:26:53 entrope Exp $
*/
#include "config.h"
@@ -180,6 +180,8 @@
close_connections(!(thisServer.bootopt & (BOOT_TTY | BOOT_DEBUG |
BOOT_CHKCONF)));
+ reap_children();
+
execv(SPATH, thisServer.argv);
/* Have to reopen since it has been closed above */
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches