refactor(network): codestyle and error handling

This commit is contained in:
Robinhuett 2018-11-14 10:31:17 +01:00
parent 50e782e028
commit 75cc1bc318
1 changed files with 10 additions and 6 deletions

View File

@ -285,8 +285,12 @@ void waybar::modules::Network::getInterfaceAddress() {
} }
ifa = ifa->ifa_next; ifa = ifa->ifa_next;
} }
}
freeifaddrs(ifaddr); freeifaddrs(ifaddr);
} else {
ipaddr_.clear();
netmask_.clear();
cidr_ = 0;
}
} }
int waybar::modules::Network::netlinkRequest(int fd, void *req, int waybar::modules::Network::netlinkRequest(int fd, void *req,