From f2882f9ef97401d9ba14b5c258c93551daca84b9 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 26 Dec 1996 16:28:28 +0000 Subject: Better error reporting. svn path=/trunk/; revision=695 --- interface.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'interface.c') diff --git a/interface.c b/interface.c index af05d7b9..39b39922 100644 --- a/interface.c +++ b/interface.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "fetchmail.h" static struct in_addr interface_address; @@ -45,8 +46,9 @@ static int _get_ifinfo_(int socket_fd, FILE *stats_file, const char *ifname, /* see if the interface is up */ strcpy(request.ifr_name, ifname); + errno = 0; if (ioctl(socket_fd, SIOCGIFFLAGS, &request) < 0) - return(FALSE); + error(PS_IOERR, errno, "interface status check failed"); if (!(request.ifr_flags & IFF_RUNNING)) return(FALSE); -- cgit v1.2.3