diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-22 03:18:05 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-22 03:18:05 +0000 |
commit | ecfdbedbc0e3bb9a610b6da08829f45aa3233d10 (patch) | |
tree | cae33a5a666e5400d1f7a2fb6bd17966ed411aef /usr.sbin/bgpd | |
parent | e41f28818352fca378f42f262ae9b466e4a970eb (diff) |
s/log_err/log_warn/
it is like warn(3), nor err(3). so use a less confusing name.
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 12 | ||||
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/control.c | 22 | ||||
-rw-r--r-- | usr.sbin/bgpd/imsg.c | 6 | ||||
-rw-r--r-- | usr.sbin/bgpd/kroute.c | 36 | ||||
-rw-r--r-- | usr.sbin/bgpd/log.c | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.c | 6 |
7 files changed, 45 insertions, 45 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 65f439c2db3..513aff93196 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.69 2004/01/20 09:44:33 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.70 2004/01/22 03:18:03 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -237,19 +237,19 @@ main(int argc, char *argv[]) if ((nfds = poll(pfd, i, INFTIM)) == -1) if (errno != EINTR) { - log_err("poll error"); + log_warn("poll error"); quit = 1; } if (nfds > 0 && (pfd[PFD_PIPE_SESSION].revents & POLLOUT)) if ((n = msgbuf_write(&ibuf_se.w)) < 0) { - log_err("pipe write error (to SE)"); + log_warn("pipe write error (to SE)"); quit = 1; } if (nfds > 0 && (pfd[PFD_PIPE_ROUTE].revents & POLLOUT)) if ((n = msgbuf_write(&ibuf_rde.w)) < 0) { - log_err("pipe write error (to RDE)"); + log_warn("pipe write error (to RDE)"); quit = 1; } @@ -276,7 +276,7 @@ main(int argc, char *argv[]) for (j = PFD_MRT_START; j < i && nfds > 0 ; j++) { if (pfd[j].revents & POLLOUT) { if ((n = mrt_write(mrt[j])) < 0) { - log_err("mrt write error"); + log_warn("mrt write error"); } } } @@ -486,7 +486,7 @@ send_nexthop_update(struct kroute_nexthop *msg) if (msg->gateway.af == AF_INET) if (asprintf(&gw, ": via %s", log_ntoa(msg->gateway.v4.s_addr)) == -1) { - log_err("send_nexthop_update"); + log_warn("send_nexthop_update"); quit = 1; } diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index cd361114248..f3d9db54318 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.74 2004/01/22 03:07:51 henning Exp $ */ +/* $OpenBSD: bgpd.h,v 1.75 2004/01/22 03:18:03 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -284,7 +284,7 @@ int msgbuf_unbounded(struct msgbuf *msgbuf); void log_init(int); void logit(int, const char *, ...); void vlog(int, const char *, va_list); -void log_err(const char *, ...); +void log_warn(const char *, ...); void fatal(const char *); void fatalx(const char *); void fatal_ensure(const char *, int, const char *); diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c index e60f1fc2a45..e6c34e4e46b 100644 --- a/usr.sbin/bgpd/control.c +++ b/usr.sbin/bgpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.18 2004/01/20 12:50:25 henning Exp $ */ +/* $OpenBSD: control.c,v 1.19 2004/01/22 03:18:03 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -45,7 +45,7 @@ control_init(void) mode_t old_umask; if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { - log_err("control_init: socket"); + log_warn("control_init: socket"); return (-1); } @@ -56,17 +56,17 @@ control_init(void) if (unlink(SOCKET_NAME) == -1) if (errno != ENOENT) { - log_err("unlink %s", SOCKET_NAME); + log_warn("unlink %s", SOCKET_NAME); return (-1); } if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) { - log_err("control_init: bind: %s", SOCKET_NAME); + log_warn("control_init: bind: %s", SOCKET_NAME); return (-1); } if (chmod(SOCKET_NAME, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) == -1) { - log_err("control_init chmod"); + log_warn("control_init chmod"); return (-1); } @@ -81,7 +81,7 @@ int control_listen(void) { if (listen(control_state.fd, CONTROL_BACKLOG) == -1) { - log_err("control_listen: listen"); + log_warn("control_listen: listen"); return (-1); } @@ -116,11 +116,11 @@ control_accept(int listenfd) if (errno == EWOULDBLOCK || errno == EINTR) return; else - log_err("session_control_accept"); + log_warn("session_control_accept"); } if (getpeereid(connfd, &uid, &gid) == -1) { - log_err("session_control_accept"); + log_warn("session_control_accept"); return; } @@ -130,7 +130,7 @@ control_accept(int listenfd) } if ((ctl_conn = malloc(sizeof(struct ctl_conn))) == NULL) { - log_err("session_control_accept"); + log_warn("session_control_accept"); return; } @@ -169,7 +169,7 @@ control_close(int fd) struct ctl_conn *c; if ((c = control_connbyfd(fd)) == NULL) { - log_err("control_close: fd %d: not found", fd); + log_warn("control_close: fd %d: not found", fd); return; } @@ -189,7 +189,7 @@ control_dispatch_msg(struct pollfd *pfd, int i) struct bgpd_addr *addr; if ((c = control_connbyfd(pfd->fd)) == NULL) { - log_err("control_dispatch_msg: fd %d: not found", pfd->fd); + log_warn("control_dispatch_msg: fd %d: not found", pfd->fd); return (0); } diff --git a/usr.sbin/bgpd/imsg.c b/usr.sbin/bgpd/imsg.c index 94c6e52a0c0..171570057ce 100644 --- a/usr.sbin/bgpd/imsg.c +++ b/usr.sbin/bgpd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.20 2004/01/09 13:47:07 henning Exp $ */ +/* $OpenBSD: imsg.c,v 1.21 2004/01/22 03:18:03 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -46,7 +46,7 @@ imsg_read(struct imsgbuf *ibuf) if ((n = read(ibuf->sock, ibuf->r.buf + ibuf->r.wpos, sizeof(ibuf->r.buf) - ibuf->r.wpos)) == -1) { if (errno != EINTR && errno != EAGAIN) { - log_err("imsg_read: pipe read error"); + log_warn("imsg_read: pipe read error"); return (-1); } return (0); @@ -79,7 +79,7 @@ imsg_get(struct imsgbuf *ibuf, struct imsg *imsg) datalen = imsg->hdr.len - IMSG_HEADER_SIZE; ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE; if ((imsg->data = malloc(datalen)) == NULL) { - log_err("imsg_get"); + log_warn("imsg_get"); return (-1); } memcpy(imsg->data, ibuf->r.rptr, datalen); diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index eb07896d2ef..ff73d3098b0 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.75 2004/01/22 03:07:51 henning Exp $ */ +/* $OpenBSD: kroute.c,v 1.76 2004/01/22 03:18:04 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -128,14 +128,14 @@ kr_init(int fs) kr_state.fib_sync = fs; if ((kr_state.fd = socket(AF_ROUTE, SOCK_RAW, 0)) == -1) { - log_err("kr_init: socket"); + log_warn("kr_init: socket"); return (-1); } /* not interested in my own messages */ if (setsockopt(kr_state.fd, SOL_SOCKET, SO_USELOOPBACK, &opt, sizeof(opt)) == -1) - log_err("kr_init: setsockopt"); /* not fatal */ + log_warn("kr_init: setsockopt"); /* not fatal */ kr_state.pid = getpid(); kr_state.rtseq = 1; @@ -175,7 +175,7 @@ kr_change(struct kroute *kroute) if (action == RTM_ADD) { if ((kr = calloc(1, sizeof(struct kroute_node))) == NULL) { - log_err("kr_change"); + log_warn("kr_change"); return (-1); } kr->r.prefix = kroute->prefix; @@ -280,7 +280,7 @@ kr_nexthop_add(struct bgpd_addr *addr) send_nexthop_update(&nh); } else { if ((h = calloc(1, sizeof(struct knexthop_node))) == NULL) { - log_err("kr_nexthop_add"); + log_warn("kr_nexthop_add"); return (-1); } memcpy(&h->nexthop, addr, sizeof(h->nexthop)); @@ -592,7 +592,7 @@ kif_kr_insert(struct kroute_node *kr) } if ((kkr = calloc(1, sizeof(struct kif_kr))) == NULL) { - log_err("kif_kr_insert"); + log_warn("kif_kr_insert"); return (-1); } @@ -739,7 +739,7 @@ protect_lo(void) /* special protection for 127/8 */ if ((kr = calloc(1, sizeof(struct kroute_node))) == NULL) { - log_err("protect_lo"); + log_warn("protect_lo"); return (-1); } kr->r.prefix = inet_addr("127.0.0.1"); @@ -863,7 +863,7 @@ if_announce(void *msg) switch (ifan->ifan_what) { case IFAN_ARRIVAL: if ((kif = calloc(1, sizeof(struct kif_node))) == NULL) { - log_err("if_announce"); + log_warn("if_announce"); return; } @@ -966,15 +966,15 @@ fetchtable(void) mib[5] = 0; if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1) { - log_err("sysctl"); + log_warn("sysctl"); return (-1); } if ((buf = malloc(len)) == NULL) { - log_err("fetchtable"); + log_warn("fetchtable"); return (-1); } if (sysctl(mib, 6, buf, &len, NULL, 0) == -1) { - log_err("sysctl"); + log_warn("sysctl"); return (-1); } @@ -991,7 +991,7 @@ fetchtable(void) continue; if ((kr = calloc(1, sizeof(struct kroute_node))) == NULL) { - log_err("fetchtable"); + log_warn("fetchtable"); return (-1); } @@ -1056,15 +1056,15 @@ fetchifs(int ifindex) mib[5] = ifindex; if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1) { - log_err("sysctl"); + log_warn("sysctl"); return (-1); } if ((buf = malloc(len)) == NULL) { - log_err("fetchif"); + log_warn("fetchif"); return (-1); } if (sysctl(mib, 6, buf, &len, NULL, 0) == -1) { - log_err("sysctl"); + log_warn("sysctl"); return (-1); } @@ -1078,7 +1078,7 @@ fetchifs(int ifindex) continue; if ((kif = calloc(1, sizeof(struct kif_node))) == NULL) { - log_err("fetchifs"); + log_warn("fetchifs"); return (-1); } @@ -1120,7 +1120,7 @@ dispatch_rtmsg(void) u_short ifindex; if ((n = read(kr_state.fd, &buf, sizeof(buf))) == -1) { - log_err("dispatch_rtmsg: read error"); + log_warn("dispatch_rtmsg: read error"); return (-1); } @@ -1212,7 +1212,7 @@ dispatch_rtmsg(void) } else { if ((kr = calloc(1, sizeof(struct kroute_node))) == NULL) { - log_err("dispatch_rtmsg"); + log_warn("dispatch_rtmsg"); return (-1); } kr->r.prefix = prefix; diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c index d3557e0335a..c98287f12fe 100644 --- a/usr.sbin/bgpd/log.c +++ b/usr.sbin/bgpd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.16 2004/01/19 23:15:08 henning Exp $ */ +/* $OpenBSD: log.c,v 1.17 2004/01/22 03:18:04 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -197,7 +197,7 @@ log_peer_errx(const struct peer *peer, const char *emsg, ...) } void -log_err(const char *emsg, ...) +log_warn(const char *emsg, ...) { char *nfmt; va_list ap; diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 650d4c9abd4..befdb4c8f5c 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.88 2004/01/17 18:05:46 henning Exp $ */ +/* $OpenBSD: session.c,v 1.89 2004/01/22 03:18:04 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -823,10 +823,10 @@ session_tcp_established(struct peer *peer) session_socket_blockmode(peer->sock, BM_NORMAL); if (getsockname(peer->sock, (struct sockaddr *)&peer->sa_local, &len) == -1) - log_err("getsockname"); + log_warn("getsockname"); if (getpeername(peer->sock, (struct sockaddr *)&peer->sa_remote, &len) == -1) - log_err("getpeername"); + log_warn("getpeername"); } void |