From 757a19b2e3f127fe3df9669c388a9027e4932820 Mon Sep 17 00:00:00 2001 From: niklas Date: Fri, 7 Apr 2000 22:06:44 +0000 Subject: [PATCH] conf.c: Merge with EOM 1.21 isakmpd.c: Merge with EOM 1.46 sa.c: Merge with EOM 1.100 ui.c: Merge with EOM 1.39 author: niklas error message style --- sbin/isakmpd/conf.c | 13 +++++++------ sbin/isakmpd/isakmpd.c | 10 +++++----- sbin/isakmpd/sa.c | 7 ++++--- sbin/isakmpd/ui.c | 17 +++++++++-------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/sbin/isakmpd/conf.c b/sbin/isakmpd/conf.c index 16b6bf94ef7..34ed58f250f 100644 --- a/sbin/isakmpd/conf.c +++ b/sbin/isakmpd/conf.c @@ -1,5 +1,5 @@ -/* $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. @@ -315,25 +315,26 @@ conf_reinit (void) 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); diff --git a/sbin/isakmpd/isakmpd.c b/sbin/isakmpd/isakmpd.c index 9ab07570fe9..878ea31adf7 100644 --- a/sbin/isakmpd/isakmpd.c +++ b/sbin/isakmpd/isakmpd.c @@ -1,5 +1,5 @@ -/* $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. @@ -291,7 +291,7 @@ main (int argc, char *argv[]) if (!debug) { if (daemon (0, 0)) - log_fatal ("main: daemon"); + log_fatal ("main: daemon (0, 0) failed"); /* Switch to syslog. */ log_to (0); } @@ -310,10 +310,10 @@ main (int argc, char *argv[]) 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) { diff --git a/sbin/isakmpd/sa.c b/sbin/isakmpd/sa.c index 2ff5a12bdea..4c314e8211b 100644 --- a/sbin/isakmpd/sa.c +++ b/sbin/isakmpd/sa.c @@ -1,5 +1,5 @@ -/* $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. @@ -80,7 +80,8 @@ sa_init () 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]); diff --git a/sbin/isakmpd/ui.c b/sbin/isakmpd/ui.c index 4161af39b52..8b28963f9eb 100644 --- a/sbin/isakmpd/ui.c +++ b/sbin/isakmpd/ui.c @@ -1,5 +1,5 @@ -/* $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. @@ -77,18 +77,19 @@ ui_init () 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); } } @@ -299,7 +300,7 @@ ui_handler () buf = malloc (sz); if (!buf) { - log_print ("malloc (%d) failed", sz); + log_print ("ui_handler: malloc (%d) failed", sz); return; } p = buf; @@ -312,7 +313,7 @@ ui_handler () 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; @@ -326,7 +327,7 @@ ui_handler () 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; } -- 2.20.1