Bug fixes and minor improvements.
[egate.git] / kernel / monitor.c
index e385ec2..aeb5cb7 100644 (file)
  * Europagate, 1995
  *
  * $Log: monitor.c,v $
- * Revision 1.9  1995/05/17 10:51:32  adam
+ * Revision 1.10  1995/05/18 12:03:09  adam
+ * Bug fixes and minor improvements.
+ *
+ * Revision 1.9  1995/05/17  10:51:32  adam
  * Added a few more error checks to the show command.
  *
  * Revision 1.8  1995/05/16  09:40:42  adam
@@ -192,7 +195,7 @@ static void catch_child (int num)
         for (ki = ke_info_list; ki; ki = ki->next)
            if (ki->pid == pid)
                 ki->pid = -1;
-/*        --no_process;*/
+        --no_process;
     }
     signal (SIGCHLD, catch_child);
 }
@@ -415,7 +418,10 @@ static void monitor_events (int argc, char **argv)
                 r = deliver (argc, argv, ki->id, ki->queue, &ki->gip, &ki->pid,
                              no_process >= max_process);
                 if (r == 2)             /* new child was spawned? */
+                {
                     ++no_process;
+                    gw_log (GW_LOG_DEBUG, module, "Start of %d", ki->id);
+                }
                 if (r == 1 || r == 2)   /* transfer at all? */
                     str_queue_rm (&ki->queue);
                 if (r == 0)             /* too many pending? */
@@ -463,7 +469,6 @@ static void monitor_events (int argc, char **argv)
                         gipc_close (ki->gip);
                         gipc_destroy (ki->gip);
                         ki->gip = NULL;
-                        --no_process;
                     }
                     else if ((fd = gip_infileno (ki->gip)) != -1)
                     {                    /* read select on child FIFO */
@@ -508,7 +513,6 @@ static void monitor_events (int argc, char **argv)
                         gipc_close (ki->gip);
                         gipc_destroy (ki->gip);
                         ki->gip = NULL;
-                        --no_process;
                     }
                 }
            }
@@ -590,6 +594,7 @@ int main (int argc, char **argv)
     signal (SIGTERM, catch_term);
     signal (SIGINT, catch_int);
 #if 1
+    gw_log_level (GW_LOG_ALL & ~RES_DEBUG);
     gw_log_file (GW_LOG_ALL, "monitor.log");
 #endif
     monitor_events (argc, argv);