diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-12-26 16:28:28 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-12-26 16:28:28 +0000 |
commit | f2882f9ef97401d9ba14b5c258c93551daca84b9 (patch) | |
tree | a1c363457dd5836a9410e9077826b71732f24da9 /interface.c | |
parent | 643203c9bf21aad67bb287b06424674d4f93017d (diff) | |
download | fetchmail-f2882f9ef97401d9ba14b5c258c93551daca84b9.tar.gz fetchmail-f2882f9ef97401d9ba14b5c258c93551daca84b9.tar.bz2 fetchmail-f2882f9ef97401d9ba14b5c258c93551daca84b9.zip |
Better error reporting.
svn path=/trunk/; revision=695
Diffstat (limited to 'interface.c')
-rw-r--r-- | interface.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/interface.c b/interface.c index af05d7b9..39b39922 100644 --- a/interface.c +++ b/interface.c @@ -19,6 +19,7 @@ #include <sys/ioctl.h> #include <netinet/in.h> #include <linux/netdevice.h> +#include <errno.h> #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); |