ndt-dev - [ndt-dev] [ndt] r786 committed - Fix an inifinite loop issue when the main process receives a SIGINT. I...
Subject: NDT-DEV email list created
List archive
[ndt-dev] [ndt] r786 committed - Fix an inifinite loop issue when the main process receives a SIGINT. I...
Chronological Thread
- From:
- To:
- Subject: [ndt-dev] [ndt] r786 committed - Fix an inifinite loop issue when the main process receives a SIGINT. I...
- Date: Fri, 26 Oct 2012 15:32:59 +0000
Revision: 786
Author:
Date: Fri Oct 26 07:36:41 2012
Log: Fix an inifinite loop issue when the main process receives a SIGINT. If it
received a SIGINT, the signal handler would try to write to stderr "hey i'm
getting a SIGINT", but stderr was closed, which cause the it to generate a
SIGPIPE, which would go into the signal handler which would try to write
to stderr "hey i'm getting a SIGPIPE", which, since stderr is still closed,
would cause a SIGPIPE to be generated, repeat for infinity. This patch just
avoids writing the "hey, i'm getting a SIGINT" which avoids starting this
infinite loop of failed writes.
http://code.google.com/p/ndt/source/detail?r=786
Modified:
/trunk/src/web100srv.c
=======================================
--- /trunk/src/web100srv.c Tue Oct 16 08:22:53 2012
+++ /trunk/src/web100srv.c Fri Oct 26 07:36:41 2012
@@ -425,12 +425,14 @@
void cleanup(int signo) {
FILE * fp;
- log_println(1, "Signal %d received by process %d", signo, getpid());
- if (get_debuglvl() > 0) {
- fp = fopen(get_logfile(), "a");
- if (fp != NULL) {
- fprintf(fp, "Signal %d received by process %d\n",
signo, getpid());
- fclose(fp);
+ if (signo != SIGINT) {
+ log_println(1, "Signal %d received by process %d", signo,
getpid());
+ if (get_debuglvl() > 0) {
+ fp = fopen(get_logfile(), "a");
+ if (fp != NULL) {
+ fprintf(fp, "Signal %d received by process
%d\n", signo, getpid());
+ fclose(fp);
+ }
}
}
switch (signo) {
- [ndt-dev] [ndt] r786 committed - Fix an inifinite loop issue when the main process receives a SIGINT. I..., ndt, 10/26/2012
Archive powered by MHonArc 2.6.16.