manoj 99/08/03 13:41:38
Modified: mpm/src/modules/mpm/dexter dexter.c
mpm/src/modules/mpm/mpmt_pthread mpmt_pthread.c
Log:
No reason to have a loop writing one byte at a time to the pipe of death
when the write call will do it for us. Also fix the comments a bit.
Revision Changes Path
1.14 +3 -5 apache-2.0/mpm/src/modules/mpm/dexter/dexter.c
Index: dexter.c
===================================================================
RCS file: /home/cvs/apache-2.0/mpm/src/modules/mpm/dexter/dexter.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -u -r1.13 -r1.14
--- dexter.c 1999/08/03 20:03:07 1.13
+++ dexter.c 1999/08/03 20:41:36 1.14
@@ -1419,11 +1419,9 @@
ap_scoreboard_image[i].status = SERVER_DYING;
}
}
- /* kill off the idle ones */
- for (i = 0; i < num_daemons; ++i) {
- if (write(pipe_of_death[1], &char_of_death, 1) == -1) {
- ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "write
pipe_of_death");
- }
+ /* give the children the signal to die */
+ if (write(pipe_of_death[1], &char_of_death, num_daemons) == -1) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "write
pipe_of_death");
}
}
else {
1.20 +5 -5
apache-2.0/mpm/src/modules/mpm/mpmt_pthread/mpmt_pthread.c
Index: mpmt_pthread.c
===================================================================
RCS file:
/home/cvs/apache-2.0/mpm/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -u -r1.19 -r1.20
--- mpmt_pthread.c 1999/08/03 20:03:09 1.19
+++ mpmt_pthread.c 1999/08/03 20:41:37 1.20
@@ -1469,11 +1469,11 @@
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
"SIGWINCH received. Doing graceful restart");
- /* kill off the idle ones */
- for (i = 0; i < ap_daemons_limit; ++i) {
- if (write(pipe_of_death[1], &char_of_death, 1) == -1) {
- ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "write
pipe_of_death");
- }
+ /* give the children the signal to die. Sending more bytes than
+ * children is okay, because the pipe is recreated for every
+ * generation */
+ if (write(pipe_of_death[1], &char_of_death, ap_daemons_limit) == -1)
{
+ ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "write
pipe_of_death");
}
/* This is mostly for debugging... so that we know what is still