summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/hce.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2011-05-05 12:01:45 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2011-05-05 12:01:45 +0000
commita3fd6084d44ed453397a1d4ee24f6c1150d1ffd0 (patch)
tree0b12db01bbbf4519d8733ef974c07b7874a89f09 /usr.sbin/relayd/hce.c
parent1715270e901acc0c8439e0337a5cdf7e37b87b83 (diff)
Update all logging and debug functions to use the __func__ macro
instead of static function names. __func__ is C99 and perfectly fine to use. It also avoids printing errors; for example if a statement log_debug("foo:"..) was moved or copied from function foo() to bar() and the log message was not updated...
Diffstat (limited to 'usr.sbin/relayd/hce.c')
-rw-r--r--usr.sbin/relayd/hce.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/relayd/hce.c b/usr.sbin/relayd/hce.c
index a0361602d12..2eb5b0c5542 100644
--- a/usr.sbin/relayd/hce.c
+++ b/usr.sbin/relayd/hce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hce.c,v 1.57 2011/02/08 08:52:28 sthen Exp $ */
+/* $OpenBSD: hce.c,v 1.58 2011/05/05 12:01:43 reyk Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -299,7 +299,7 @@ hce_notify_done(struct host *host, enum host_error he)
host->he = he;
if (host->up == HOST_DOWN && host->retry_cnt) {
- log_debug("hce_notify_done: host %s retry %d",
+ log_debug("%s: host %s retry %d", __func__,
host->conf.name, host->retry_cnt);
host->up = host->last_up;
host->retry_cnt--;
@@ -318,7 +318,7 @@ hce_notify_done(struct host *host, enum host_error he)
host->flags |= (F_CHECK_SENT|F_CHECK_DONE);
msg = host_error(he);
if (msg)
- log_debug("hce_notify_done: %s (%s)", host->conf.name, msg);
+ log_debug("%s: %s (%s)", __func__, host->conf.name, msg);
imsg_compose_event(iev_pfe, IMSG_HOST_STATUS,
0, 0, -1, &st, sizeof(st));
@@ -452,7 +452,7 @@ hce_dispatch_imsg(int fd, short event, void *ptr)
log_verbose(verbose);
break;
default:
- log_debug("hce_dispatch_msg: unexpected imsg %d",
+ log_debug("%s: unexpected imsg %d", __func__,
imsg.hdr.type);
break;
}
@@ -508,7 +508,7 @@ hce_dispatch_parent(int fd, short event, void * ptr)
script_done(env, &scr);
break;
case IMSG_RECONF:
- log_debug("hce: reloading configuration");
+ log_debug("%s: reloading configuration", __func__);
if (imsg.hdr.len !=
sizeof(struct relayd) + IMSG_HEADER_SIZE)
fatalx("corrupted reload data");
@@ -547,11 +547,11 @@ hce_dispatch_parent(int fd, short event, void * ptr)
}
break;
case IMSG_RECONF_END:
- log_warnx("hce: configuration reloaded");
+ log_warnx("%s: configuration reloaded", __func__);
hce_setup_events();
break;
default:
- log_debug("hce_dispatch_parent: unexpected imsg %d",
+ log_debug("%s: unexpected imsg %d", __func__,
imsg.hdr.type);
break;
}