-/* $OpenBSD: conf.c,v 1.11 2000/02/25 17:23:38 niklas Exp $ */
-/* $EOM: conf.c,v 1.20 2000/02/20 19:58:36 niklas Exp $ */
+/* $OpenBSD: conf.c,v 1.12 2000/04/07 22:06:44 niklas Exp $ */
+/* $EOM: conf.c,v 1.21 2000/04/07 19:03:25 niklas Exp $ */
/*
* Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved.
fd = open (conf_path, O_RDONLY);
if (fd == -1)
{
- log_error ("open (\"%s\", O_RDONLY) failed", conf_path);
+ log_error ("conf_reinit: open (\"%s\", O_RDONLY) failed", conf_path);
return;
}
if (fstat (fd, &st) == -1)
{
- log_error ("fstat (%d, &st) failed", fd);
+ log_error ("conf_reinit: fstat (%d, &st) failed", fd);
goto fail;
}
sz = st.st_size;
new_conf_addr = malloc (sz);
if (!new_conf_addr)
{
- log_error ("malloc (%d) failed", sz);
+ log_error ("conf_reinit: malloc (%d) failed", sz);
goto fail;
}
/* XXX I assume short reads won't happen here. */
if (read (fd, new_conf_addr, sz) != sz)
{
- log_error ("read (%d, %p, %d) failed", fd, new_conf_addr, sz);
+ log_error ("conf_reinit: read (%d, %p, %d) failed", fd, new_conf_addr,
+ sz);
goto fail;
}
close (fd);
-/* $OpenBSD: isakmpd.c,v 1.20 2000/02/25 17:23:39 niklas Exp $ */
-/* $EOM: isakmpd.c,v 1.45 2000/02/20 19:58:39 niklas Exp $ */
+/* $OpenBSD: isakmpd.c,v 1.21 2000/04/07 22:06:44 niklas Exp $ */
+/* $EOM: isakmpd.c,v 1.46 2000/04/07 19:03:25 niklas Exp $ */
/*
* Copyright (c) 1998, 1999, 2000 Niklas Hallqvist. All rights reserved.
if (!debug)
{
if (daemon (0, 0))
- log_fatal ("main: daemon");
+ log_fatal ("main: daemon (0, 0) failed");
/* Switch to syslog. */
log_to (0);
}
mask_size = howmany (n, NFDBITS) * sizeof (fd_mask);
rfds = (fd_set *)malloc (mask_size);
if (!rfds)
- log_fatal ("main: malloc (%d)", mask_size);
+ log_fatal ("main: malloc (%d) failed", mask_size);
wfds = (fd_set *)malloc (mask_size);
if (!wfds)
- log_fatal ("main: malloc (%d)", mask_size);
+ log_fatal ("main: malloc (%d) failed", mask_size);
while (1)
{
-/* $OpenBSD: sa.c,v 1.25 2000/02/25 17:23:38 niklas Exp $ */
-/* $EOM: sa.c,v 1.99 2000/02/20 19:58:42 niklas Exp $ */
+/* $OpenBSD: sa.c,v 1.26 2000/04/07 22:06:44 niklas Exp $ */
+/* $EOM: sa.c,v 1.100 2000/04/07 19:05:01 niklas Exp $ */
/*
* Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved.
bucket_mask = (1 << INITIAL_BUCKET_BITS) - 1;
sa_tab = malloc ((bucket_mask + 1) * sizeof (struct sa_list));
if (!sa_tab)
- log_fatal ("init_sa: out of memory");
+ log_fatal ("sa_init: malloc (%s) failed",
+ (bucket_mask + 1) * sizeof (struct sa_list));
for (i = 0; i <= bucket_mask; i++)
{
LIST_INIT (&sa_tab[i]);
-/* $OpenBSD: ui.c,v 1.13 2000/03/08 08:42:38 niklas Exp $ */
-/* $EOM: ui.c,v 1.38 2000/03/07 20:22:14 niklas Exp $ */
+/* $OpenBSD: ui.c,v 1.14 2000/04/07 22:06:44 niklas Exp $ */
+/* $EOM: ui.c,v 1.39 2000/04/07 19:05:01 niklas Exp $ */
/*
* Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved.
if ((st.st_mode & S_IFMT) == S_IFREG)
{
errno = EEXIST;
- log_fatal ("could not create FIFO \"%s\"", ui_fifo);
+ log_fatal ("ui_init: could not create FIFO \"%s\"", ui_fifo);
}
/* No need to know about errors. */
unlink (ui_fifo);
if (mkfifo (ui_fifo, 0600) == -1)
- log_fatal ("mkfifo");
+ log_fatal ("ui_init: mkfifo (\"%s\", 0600) failed");
/* XXX Is O_RDWR needed on some OSes? Photurisd seems to imply that. */
ui_socket = open (ui_fifo, O_RDONLY | O_NONBLOCK, 0);
if (ui_socket == -1)
- log_fatal (ui_fifo);
+ log_fatal ("ui_init: open (\"%s\", O_RDONLY | O_NONBLOCK, 0) failed",
+ ui_fifo);
}
}
buf = malloc (sz);
if (!buf)
{
- log_print ("malloc (%d) failed", sz);
+ log_print ("ui_handler: malloc (%d) failed", sz);
return;
}
p = buf;
new_buf = realloc (buf, sz * 2);
if (!new_buf)
{
- log_print ("realloc (%p, %d) failed", buf, sz * 2);
+ log_print ("ui_handler: realloc (%p, %d) failed", buf, sz * 2);
free (buf);
buf = 0;
return;
n = read (ui_socket, p, resid);
if (n == -1)
{
- log_error ("read (%d, %p, %d)", ui_socket, p, resid);
+ log_error ("ui_handler: read (%d, %p, %d)", ui_socket, p, resid);
return;
}