More work on resource monitor.
[egate.git] / kernel / main.c
index 0825d96..63d6a4f 100644 (file)
@@ -2,7 +2,10 @@
  * Europagate, 1995
  *
  * $Log: main.c,v $
- * Revision 1.20  1995/05/01 12:43:32  adam
+ * Revision 1.21  1995/05/01 16:26:56  adam
+ * More work on resource monitor.
+ *
+ * Revision 1.20  1995/05/01  12:43:32  adam
  * First work on resource monitor program.
  *
  * Revision 1.19  1995/04/19  16:01:58  adam
@@ -100,9 +103,10 @@ static void kernel_events (struct str_queue *queue, int userid)
     struct timeval tv;
     int timeout;
     int continuation = 0;
+    int extra_fd;
 
     timeout = atoi(gw_res_get (info.kernel_res, "gw.timeout", "600"));
-    gw_log (GW_LOG_DEBUG, KERNEL_LOG, "kernel event loop");
+    gw_log (GW_LOG_DEBUG, KERNEL_LOG, "event loop");
 
     sprintf (fifo_client_name, "fifo.c.%d", userid);
     sprintf (fifo_server_name, "fifo.s.%d", userid);
@@ -110,7 +114,7 @@ static void kernel_events (struct str_queue *queue, int userid)
     gip = gips_initialize (fifo_server_name);
     gips_open (gip, fifo_client_name);
     gip_fd = gip_infileno (gip);
-    open (fifo_server_name, O_WRONLY);
+    extra_fd = open (fifo_server_name, O_WRONLY);
 
     while (1)
     {
@@ -171,6 +175,7 @@ static void kernel_events (struct str_queue *queue, int userid)
            continuation = 1;
        }
     }
+    close (extra_fd);
     gips_close (gip);
     gips_destroy (gip);
     unlink (fifo_client_name);