From f0fa4e0c9085e0b4476b144185040ce9fbdc11e3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 30 Aug 2013 12:57:25 +0200 Subject: Demote some sendmsg warnings to debug and debug2 levels --- src/send.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/send.c b/src/send.c index 3a990d2..c624405 100644 --- a/src/send.c +++ b/src/send.c @@ -115,8 +115,25 @@ static void send_type(fastd_context_t *ctx, const fastd_socket_t *sock, const fa ret = sendmsg(sock->fd, &msg, 0); } while (ret < 0 && errno == EINTR); - if (ret < 0) - pr_warn_errno(ctx, "sendmsg"); + if (ret < 0) { + switch (errno) { + case EAGAIN: +#if EAGAIN != EWOULDBLOCK + case EWOULDBLOCK: +#endif + pr_debug2_errno(ctx, "sendmsg"); + break; + + case ENETDOWN: + case ENETUNREACH: + case EHOSTUNREACH: + pr_debug_errno(ctx, "sendmsg"); + break; + + default: + pr_warn_errno(ctx, "sendmsg"); + } + } fastd_buffer_free(buffer); } -- cgit v1.2.3