projects
/
egate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
aa975e8
)
Bug fix: stopped kernels sometimes got IPC messages from the monitor.
author
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 19 May 1995 14:51:06 +0000
(14:51 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 19 May 1995 14:51:06 +0000
(14:51 +0000)
kernel/monitor.c
patch
|
blob
|
history
diff --git
a/kernel/monitor.c
b/kernel/monitor.c
index
8982094
..
3ed0cc6
100644
(file)
--- a/
kernel/monitor.c
+++ b/
kernel/monitor.c
@@
-45,7
+45,10
@@
* Europagate, 1995
*
* $Log: monitor.c,v $
* Europagate, 1995
*
* $Log: monitor.c,v $
- * Revision 1.11 1995/05/19 13:26:00 adam
+ * Revision 1.12 1995/05/19 14:51:06 adam
+ * Bug fix: stopped kernels sometimes got IPC messages from the monitor.
+ *
+ * Revision 1.11 1995/05/19 13:26:00 adam
* Bug fixes. Better command line options.
*
* Revision 1.10 1995/05/18 12:03:09 adam
* Bug fixes. Better command line options.
*
* Revision 1.10 1995/05/18 12:03:09 adam
@@
-143,6
+146,7
@@
static void reread_resources (void)
struct ke_info {
int id; /* email user-id */
struct ke_info {
int id; /* email user-id */
+ int stopped; /* stop flag */
pid_t pid; /* pid of email kernel child */
GIP gip; /* fifo information */
struct str_queue *queue; /* message queue */
pid_t pid; /* pid of email kernel child */
GIP gip; /* fifo information */
struct str_queue *queue; /* message queue */
@@
-170,6
+174,7
@@
struct ke_info *ke_info_add (int id)
(*kip)->id = id;
(*kip)->gip = NULL;
(*kip)->queue = NULL;
(*kip)->id = id;
(*kip)->gip = NULL;
(*kip)->queue = NULL;
+ (*kip)->stopped = 0;
return *kip;
}
return *kip;
}
@@
-361,7
+366,10
@@
static int deliver (int argc, char **argv, int id, struct str_queue *queue,
}
index = 0; /* transfer. may be interrupted */
while ((msg = str_queue_get (queue, index++)))
}
index = 0; /* transfer. may be interrupted */
while ((msg = str_queue_get (queue, index++)))
+ {
+ gw_log (GW_LOG_DEBUG, module, "deliver: %s", msg);
gip_wline (*gip, msg);
gip_wline (*gip, msg);
+ }
signal (SIGPIPE, oldsig);
return pass; /* successful transfer */
}
signal (SIGPIPE, oldsig);
return pass; /* successful transfer */
}
@@
-416,7
+424,7
@@
static void monitor_events (int argc, char **argv)
too_many = 0;
for (ki = ke_info_list; ki; ki = ki->next)
{
too_many = 0;
for (ki = ke_info_list; ki; ki = ki->next)
{
- if (!ki->queue)
+ if (!ki->queue || ki->stopped)
continue;
gw_log (GW_LOG_DEBUG, module, "Transfer mail to %d", ki->id);
r = deliver (argc, argv, ki->id, ki->queue, &ki->gip, &ki->pid,
continue;
gw_log (GW_LOG_DEBUG, module, "Transfer mail to %d", ki->id);
r = deliver (argc, argv, ki->id, ki->queue, &ki->gip, &ki->pid,
@@
-431,14
+439,13
@@
static void monitor_events (int argc, char **argv)
if (r == 0) /* too many pending? */
too_many++;
}
if (r == 0) /* too many pending? */
too_many++;
}
-#if 0
if (too_many)
{
gw_log (GW_LOG_DEBUG, module, "%d too many pending",
too_many);
for (ki = ke_info_list; ki; ki = ki->next)
{
if (too_many)
{
gw_log (GW_LOG_DEBUG, module, "%d too many pending",
too_many);
for (ki = ke_info_list; ki; ki = ki->next)
{
- if (!ki->queue && ki->pid != -1)
+ if (!ki->queue && ki->pid != -1 && !ki->stopped)
{
if (!(ki->queue = str_queue_mk ()))
{
{
if (!(ki->queue = str_queue_mk ()))
{
@@
-454,11
+461,11
@@
static void monitor_events (int argc, char **argv)
gw_log (GW_LOG_DEBUG, module,
"Stop not sent: %d", r);
str_queue_rm (&ki->queue);
gw_log (GW_LOG_DEBUG, module,
"Stop not sent: %d", r);
str_queue_rm (&ki->queue);
+ ki->stopped = 1;
break;
}
}
}
break;
}
}
}
-#endif
FD_ZERO (&set_r);
FD_SET (gip_m_fd, &set_r);
gw_log (GW_LOG_DEBUG, module, "set gip_m_fd %d", gip_m_fd);
FD_ZERO (&set_r);
FD_SET (gip_m_fd, &set_r);
gw_log (GW_LOG_DEBUG, module, "set gip_m_fd %d", gip_m_fd);
@@
-475,6
+482,7
@@
static void monitor_events (int argc, char **argv)
gipc_close (ki->gip);
gipc_destroy (ki->gip);
ki->gip = NULL;
gipc_close (ki->gip);
gipc_destroy (ki->gip);
ki->gip = NULL;
+ ki->stopped = 0;
}
else if ((fd = gip_infileno (ki->gip)) != -1)
{ /* read select on child FIFO */
}
else if ((fd = gip_infileno (ki->gip)) != -1)
{ /* read select on child FIFO */
@@
-519,6
+527,7
@@
static void monitor_events (int argc, char **argv)
gipc_close (ki->gip);
gipc_destroy (ki->gip);
ki->gip = NULL;
gipc_close (ki->gip);
gipc_destroy (ki->gip);
ki->gip = NULL;
+ ki->stopped = 0;
}
}
}
}
}
}