From: John Crispin Date: Sat, 30 Aug 2014 10:24:52 +0000 (+0200) Subject: sane error message when read fails X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=577a15292736d87c656fe884bbe14be3605f8b49;p=oweals%2Fmdnsd.git sane error message when read fails Signed-off-by: John Crispin --- diff --git a/interface.c b/interface.c index 7f53653..0d34e72 100644 --- a/interface.c +++ b/interface.c @@ -162,8 +162,8 @@ read_socket(struct uloop_fd *u, unsigned int events) msg.msg_controllen = sizeof(cmsg6); len = recvmsg(u->fd, &msg, flags); - if (len < 0) { - fprintf(stderr, "%s:%s[%d]\n", __FILE__, __func__, __LINE__); + if (len == -1) { + perror("read failed"); return; } for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL && ifindex == -1; cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) {