From: Adam Dickmeiss Date: Tue, 28 Mar 1995 08:01:23 +0000 (+0000) Subject: FIFO existence is used to test for a running kernel. X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=43c5b3372d7c17b2c196e90115fb6058b813b003;p=egate.git FIFO existence is used to test for a running kernel. --- diff --git a/kernel/eti.c b/kernel/eti.c index 183f0e3..0398f56 100644 --- a/kernel/eti.c +++ b/kernel/eti.c @@ -2,7 +2,10 @@ * Europagate, 1995 * * $Log: eti.c,v $ - * Revision 1.2 1995/03/27 12:51:05 adam + * Revision 1.3 1995/03/28 08:01:23 adam + * FIFO existence is used to test for a running kernel. + * + * Revision 1.2 1995/03/27 12:51:05 adam * New log level in use: GW_LOG_ERRNO. * * Revision 1.1 1995/03/27 08:24:00 adam @@ -18,6 +21,8 @@ #include #include #include +#include +#include #include #include @@ -27,6 +32,12 @@ static char line_buf[LINE_MAX+1]; static char *module = "eti"; +static jmp_buf retry_jmp; + +static void pipe_handle (int dummy) +{ + longjmp (retry_jmp, 1); +} static int email_header (FILE *inf, char *from_str, char *subject_str) { @@ -45,17 +56,39 @@ static int email_header (FILE *inf, char *from_str, char *subject_str) return 1; } -static int kernel_active (int id) +static void start_kernel (int argc, char **argv, int id) { - char active_name[1024]; - int fd; + pid_t pid; + int i; + char **argv_p; + char userid_option[20]; - sprintf (active_name, "kernel.pid.%d", id); - fd = open (active_name, O_RDONLY); - if (fd == -1) - return 0; - close (fd); - return 1; + argv_p = malloc (sizeof(*argv_p)*(argc+2)); + if (!argv_p) + { + gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, module, "malloc fail"); + exit (1); + } + argv_p[0] = "kernel"; + for (i = 1; i