From 65c009df1c2b3432cb3686a6a3941965fabcbbfd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 10 May 2004 21:32:00 +0000 Subject: preliminary work for ifplugd 0.25 git-svn-id: file:///home/lennart/svn/public/ifplugd/trunk@110 2bf48fe7-cfc1-0310-909f-d9042e1e0fef --- src/ifplugstatus.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/ifplugstatus.c') diff --git a/src/ifplugstatus.c b/src/ifplugstatus.c index e4db11b..04c59b9 100644 --- a/src/ifplugstatus.c +++ b/src/ifplugstatus.c @@ -51,11 +51,6 @@ int handle(char *iface) { if (verbose > 0) { printf("%s:\n", iface); - if ((s = interface_detect_beat_iff(fd, iface)) == IFSTATUS_ERR) - printf(" IFF_RUNNING failed.\n"); - else - printf(" IFF_RUNNING: %s\n", s == IFSTATUS_UP ? "link beat detected" : "unplugged"); - if ((s = interface_detect_beat_ethtool(fd, iface)) == IFSTATUS_ERR) printf(" SIOCETHTOOL failed (%s)\n", strerror(errno)); else @@ -71,18 +66,22 @@ int handle(char *iface) { else printf(" Wireless: %s\n", s == IFSTATUS_UP ? "link beat detected" : "unplugged"); + if ((s = interface_detect_beat_iff(fd, iface)) == IFSTATUS_ERR) + printf(" IFF_RUNNING failed.\n"); + else + printf(" IFF_RUNNING: %s\n", s == IFSTATUS_UP ? "link beat detected" : "unplugged"); + if ((s = interface_detect_beat_priv(fd, iface)) == IFSTATUS_ERR) printf(" SIOCDEVPRIVATE failed (%s)\n", strerror(errno)); else printf(" SIOCDEVPRIVATE: %s\n", s == IFSTATUS_UP ? "link beat detected" : "unplugged"); } else { - - if ((s = interface_detect_beat_iff(fd, iface)) == IFSTATUS_ERR) - if ((s = interface_detect_beat_ethtool(fd, iface)) == IFSTATUS_ERR) - if ((s = interface_detect_beat_mii(fd, iface)) == IFSTATUS_ERR) - if ((s = interface_detect_beat_wlan(fd, iface)) == IFSTATUS_ERR) - s = interface_detect_beat_priv(fd, iface); + + if ((s = interface_detect_beat_ethtool(fd, iface)) == IFSTATUS_ERR) + if ((s = interface_detect_beat_mii(fd, iface)) == IFSTATUS_ERR) + if ((s = interface_detect_beat_wlan(fd, iface)) == IFSTATUS_ERR) + s = interface_detect_beat_iff(fd, iface); switch(s) { case IFSTATUS_UP: -- cgit