# Europagate, 1995
#
# $Log: Makefile,v $
-# Revision 1.12 1995/03/27 08:23:57 adam
+# Revision 1.13 1995/03/27 12:51:04 adam
+# New log level in use: GW_LOG_ERRNO.
+#
+# Revision 1.12 1995/03/27 08:23:57 adam
# First use of gip interface and gw-db.
# First work on eti program.
#
ZLIB=$(ZPRE)/libz3950.a
INCLUDE=-I../include
-CFLAGS=-g -Wall
+#CFLAGS=-g -Wall
CPP=$(CC) -E
DEFS=$(INCLUDE) -DUSE_FML=1
USELIBS1=../lib/ccl.a ../lib/fml.a ../lib/libzass.a ../lib/libres+log.a \
* Europagate, 1995
*
* $Log: eti.c,v $
- * Revision 1.1 1995/03/27 08:24:00 adam
+ * 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
* First use of gip interface and gw-db.
* First work on eti program.
*
argv_p = malloc (sizeof(*argv_p)*(argc+2));
if (!argv_p)
{
- gw_log (GW_LOG_FATAL, module, "Malloc fail");
+ gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, module, "Malloc fail");
exit (1);
}
argv_p[0] = "kernel";
pid = fork ();
if (pid == -1)
{
- gw_log (GW_LOG_FATAL, module, "fork");
+ gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, module, "fork");
exit (1);
}
if (!pid)
{
execvp ("kernel", argv_p);
- gw_log (GW_LOG_FATAL, module, "execvp");
+ gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, module, "execvp");
exit (1);
}
gipc_open (gip, fifo_server_name, 1);
* Europagate, 1995
*
* $Log: main.c,v $
- * Revision 1.11 1995/03/27 08:24:02 adam
+ * Revision 1.12 1995/03/27 12:51:05 adam
+ * New log level in use: GW_LOG_ERRNO.
+ *
+ * Revision 1.11 1995/03/27 08:24:02 adam
* First use of gip interface and gw-db.
* First work on eti program.
*
fd = open (active_name, O_WRONLY|O_CREAT, 0666);
if (fd == -1)
{
- gw_log (GW_LOG_FATAL, "Cannot create %s", active_name);
+ gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, "Cannot create %s", active_name);
exit (1);
}
sprintf (pid_buf, "%ld", (long) getpid());
r = select (gip_fd+1, &set_r, NULL, NULL, &tv);
if (r == -1)
{
- gw_log (GW_LOG_FATAL, KERNEL_LOG, "select fail");
+ gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, KERNEL_LOG, "select");
exit (1);
}
if (r == 0)
{
switch (argv[0][1])
{
+ case 'H':
+ fprintf (stderr, "kernel [option..] [resource]\n");
+ fprintf (stderr, "If no resource file is given");
+ fprintf (stderr, " default.res is used\n");
+ fprintf (stderr, "Options:\n");
+ fprintf (stderr, " -d Enable debugging log\n");
+ fprintf (stderr, " -t target Open target immediately\n");
+ fprintf (stderr, " -l lang Set language\n");
+ fprintf (stderr, " -o resource Override with resource\n");
+ fprintf (stderr, " -h host Override host\n");
+ fprintf (stderr, " -p port Override port\n");
+ fprintf (stderr, " -g log Set Log file\n");
+ fprintf (stderr, " -i id Set IPC userid\n");
+ exit (1);
case 'd':
gw_log_level (GW_LOG_ALL);
break;
}
else
{
- gw_log (GW_LOG_FATAL, KERNEL_LOG, "missing language name");
+ gw_log (GW_LOG_FATAL, KERNEL_LOG, "missing override name");
exit (1);
}
break;
* Europagate, 1995
*
* $Log: urp.c,v $
- * Revision 1.21 1995/03/27 08:24:04 adam
+ * Revision 1.22 1995/03/27 12:51:05 adam
+ * New log level in use: GW_LOG_ERRNO.
+ *
+ * Revision 1.21 1995/03/27 08:24:04 adam
* First use of gip interface and gw-db.
* First work on eti program.
*
if ((r=read (fd, buf+no, 1)) != 1)
{
if (r == -1)
- gw_log (GW_LOG_WARN, KERNEL_LOG, "read fail");
+ gw_log (GW_LOG_WARN|GW_LOG_ERRNO, KERNEL_LOG, "read fail");
buf[no] = '\0';
return 0;
}
{ "status", "status" },
{ "cancel", "cancel" },
{ "target", "target" },
+{ "stop", "stop" },
{ NULL, NULL }
};
record_log_name );
record_log_fd = open (path, O_WRONLY|O_CREAT|O_APPEND, 0666);
if (record_log_fd == -1)
- gw_log (GW_LOG_WARN, "Cannot open %s", path);
+ gw_log (GW_LOG_WARN|GW_LOG_ERRNO, "Cannot open %s", path);
}
fprintf (reply_fd, gw_res_get (info.kernel_res,
"gw.msg.records",
reply_fd = fopen (reply_fname, "w");
if (!reply_fd)
{
- gw_log (GW_LOG_FATAL, KERNEL_LOG, "Cannot create %s",
+ gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, KERNEL_LOG, "Cannot create %s",
reply_fname);
return -1;
}
mta_code = system (cmd);
if (mta_code)
- gw_log (GW_LOG_FATAL, KERNEL_LOG, "Reply '%s' got exit code %d",
- cmd, mta_code);
+ gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, KERNEL_LOG,
+ "Reply '%s' got exit code %d", cmd, mta_code);
unlink (reply_fname);
gw_log (GW_LOG_ACCT, KERNEL_LOG, "User end %s", from_str);
}
# Europagate, 1994-1995.
#
# $Log: Makefile,v $
-# Revision 1.4 1995/02/23 08:32:20 adam
+# Revision 1.5 1995/03/27 12:51:10 adam
+# New log level in use: GW_LOG_ERRNO.
+#
+# Revision 1.4 1995/02/23 08:32:20 adam
# Changed header.
#
# Revision 1.2 1995/02/22 08:51:44 adam
#
SHELL=/bin/sh
INCLUDE=-I../include
-CFLAGS=-Wall -pedantic -ansi
+#CFLAGS=-Wall -pedantic -ansi
CPP=$(CC) -E
TPROG1=gw-log-test
TPROG2=gw-res-test
* Europagate, 1994-1995.
*
* $Log: gw-log.c,v $
- * Revision 1.4 1995/02/23 08:32:22 adam
+ * Revision 1.5 1995/03/27 12:51:10 adam
+ * New log level in use: GW_LOG_ERRNO.
+ *
+ * Revision 1.4 1995/02/23 08:32:22 adam
* Changed header.
*
* Revision 1.2 1995/02/17 17:06:56 adam
#include <fcntl.h>
#include <unistd.h>
#include <time.h>
+#include <errno.h>
#include <gw-log.h>
*cp = ' ';
count = strlen (emit_str);
vsprintf (emit_str+count, format, ap);
+ if (e_level & GW_LOG_ERRNO)
+ {
+ strcat (emit_str, ": ");
+ strcat (emit_str, strerror (errno));
+ }
strcat (emit_str, "\n");
count = strlen (emit_str);