diff options
author | 2017-01-23 23:35:42 +0000 | |
---|---|---|
committer | 2017-01-23 23:35:42 +0000 | |
commit | 2324939d336be80686a78d2575a0b5576e2c4683 (patch) | |
tree | d9bed608b20e11e89cc53b83c117b353eea9b9e0 | |
parent | Make util.c fatal() free by allowing undefined behaviour in prefix_compare. (diff) | |
download | wireguard-openbsd-2324939d336be80686a78d2575a0b5576e2c4683.tar.xz wireguard-openbsd-2324939d336be80686a78d2575a0b5576e2c4683.zip |
cleanup log* functions that break with bgpd reacharound
ok claudio@
-rw-r--r-- | usr.sbin/bgpctl/bgpctl.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index eb14bfe73ef..492d04a5e85 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.191 2017/01/13 18:59:12 phessler Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.192 2017/01/23 23:35:42 benno Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -38,7 +38,6 @@ #include "bgpd.h" #include "session.h" #include "rde.h" -#include "log.h" #include "parser.h" #include "irrfilter.h" #include "mrtparser.h" @@ -100,6 +99,15 @@ const char *msg_type(u_int8_t); void network_bulk(struct parse_result *); const char *print_auth_method(enum auth_method); +/* + * XXX Your Mission, Should You Choose To Accept It + * is to get rid of the reacharound into bgpd XXX + */ +__dead void fatal(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +__dead void fatalx(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); + struct imsgbuf *ibuf; struct mrt_parser show_mrt = { show_mrt_dump, show_mrt_state, show_mrt_msg }; struct mrt_parser net_mrt = { network_mrt_dump, NULL, NULL }; @@ -2015,39 +2023,24 @@ msg_type(u_int8_t type) return (msgtypenames[type]); } -/* following functions are necessary for the imsg framework */ -void -log_warnx(const char *emsg, ...) -{ - va_list ap; - - va_start(ap, emsg); - vwarnx(emsg, ap); - va_end(ap); -} - +/* XXX get rid of the reacharound XXX */ void -log_warn(const char *emsg, ...) +fatal(const char *emsg, ...) { va_list ap; va_start(ap, emsg); - vwarn(emsg, ap); + verr(1, emsg, ap); va_end(ap); } void -fatal(const char *emsg, ...) +fatalx(const char *emsg, ...) { va_list ap; va_start(ap, emsg); - verr(1, emsg, ap); + verrx(1, emsg, ap); va_end(ap); } -void -fatalx(const char *emsg) -{ - errx(1, "%s", emsg); -} |