Idefisk
Tools
Tutorials
Reviews
VoIP Providers
Archives
AsteriskGuru Archives
Mailing List Archives
FAQ
Search
Memberlist
Usergroups
Register
Profile
Log in to check your private messages
Log in
[Asterisk-cvs] asterisk asterisk.c,1.20,1.21
AsteriskGuru Archives Forum Index
->
Asterisk-CVS
View previous topic
::
View next topic
Author
Message
markster at lists.digium.
Guest
Posted: Tue Sep 16, 2003 7:34 pm
Post subject: [Asterisk-cvs] asterisk asterisk.c,1.20,1.21
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv23699
Modified Files:
asterisk.c
Log Message:
Improve child process reaping (bug #278)
Index: asterisk.c
===================================================================
RCS file: /usr/cvsroot/asterisk/asterisk.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- asterisk.c 8 Sep 2003 16:48:06 -0000 1.20
+++ asterisk.c 16 Sep 2003 19:35:56 -0000 1.21
@@ -337,11 +337,19 @@
ast_module_reload();
}
-
-static void pipe_handler(int num)
+static void child_handler(int sig)
{
- /* Ignore sigpipe */
+ int n, status;
+
+ /*
+ * Reap all dead children -- not just one
+ */
+ for (n = 0; wait4(-1, &status, WNOHANG, NULL) > 0; n++)
+ ;
+ if (n == 0 && option_debug)
+ ast_log(LOG_DEBUG, "Huh? Child handler, but nobody there?\n");
}
+
static void set_title(char *text)
{
/* Set an X-term or screen title */
@@ -1366,11 +1374,14 @@
}
if (option_console && !option_verbose)
ast_verbose("[ Booting...");
+
signal(SIGURG, urg_handler);
signal(SIGINT, __quit_handler);
signal(SIGTERM, __quit_handler);
signal(SIGHUP, hup_handler);
- signal(SIGPIPE, pipe_handler);
+ signal(SIGCHLD, child_handler);
+ signal(SIGPIPE, SIG_IGN);
+
if (set_priority(option_highpriority)) {
printf(term_quit());
exit(1);
Back to top
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
AsteriskGuru Archives Forum Index
->
Asterisk-CVS
All times are GMT
Page
1
of
1
Jump to:
Select a forum
Asterisk Mailing Lists
----------------
Asterisk-Users
Asterisk-Dev
Asterisk-CVS
Asterisk-Biz
Asterisk-Doc
Asterisk-BSD
Asterisk-Announce
Asterisk Call Centers
Asterisk-Video
Asterisk-Speech-Rec
Bristuff-Users
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
edit your posts in this forum
You
cannot
delete your posts in this forum
You
cannot
vote in polls in this forum
Powered by
phpBB
© 2001, 2005 phpBB Group