]> Pileus Git - ~andy/fetchmail/commitdiff
Better error reporting.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 26 Dec 1996 16:28:28 +0000 (16:28 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 26 Dec 1996 16:28:28 +0000 (16:28 -0000)
svn path=/trunk/; revision=695

interface.c

index af05d7b9c5631c94867429e6b50799119b7e7648..39b399223e738315ec464a0baa30c6bf43ba5fa8 100644 (file)
@@ -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);