commit 5a92ce669539b031d2b93ca79271b23babc21761
parent 388b556835c09605cdbaff557ebb6a5efc19fb0c
Author: sin <sin@2f30.org>
Date: Wed, 22 Mar 2017 09:43:27 +0000
Remove logerr{,x}()
Since these are not fatal they are a bit misleading. There's
already fatal{,x}() for those conditions.
Diffstat:
4 files changed, 3 insertions(+), 27 deletions(-)
diff --git a/log.c b/log.c
@@ -76,28 +76,6 @@ logwarnx(char *msg, ...)
}
void
-logerr(char *msg, ...)
-{
- char buf[512];
- va_list ap;
-
- va_start(ap, msg);
- snprintf(buf, sizeof(buf), "%s: %s", msg, strerror(errno));
- vlog(LOG_DAEMON | LOG_ERR, buf, ap);
- va_end(ap);
-}
-
-void
-logerrx(char *msg, ...)
-{
- va_list ap;
-
- va_start(ap, msg);
- vlog(LOG_DAEMON | LOG_ERR, msg, ap);
- va_end(ap);
-}
-
-void
fatal(char *msg, ...)
{
char buf[512];
diff --git a/netpkt.c b/netpkt.c
@@ -49,7 +49,7 @@ netwrite(int fd, unsigned char *pt, size_t ptlen, size_t *outlen)
int n, total = 0;
if (buflen > maxbuflen) {
- logerrx("packet is too large");
+ logwarnx("packet is too large");
return PKTFAILED;
}
@@ -86,7 +86,7 @@ netread(int fd, unsigned char *pt, size_t ptlen, size_t *outlen)
int n, ctlen;
if (buflen > maxbuflen) {
- logerrx("packet is too large");
+ logwarnx("packet is too large");
return PKTFAILED;
}
diff --git a/server.c b/server.c
@@ -48,7 +48,7 @@ serverinit(char *host, char *port)
break;
}
if (!p)
- logerrx("failed to bind socket");
+ logwarnx("failed to bind socket");
freeaddrinfo(ai);
return listenfd;
}
diff --git a/stun.h b/stun.h
@@ -63,8 +63,6 @@ void logdbg(char *, ...);
void logdbgx(char *, ...);
void logwarn(char *, ...);
void logwarnx(char *, ...);
-void logerr(char *, ...);
-void logerrx(char *, ...);
void fatal(char *, ...);
void fatalx(char *, ...);