#
-# Copyright (C) 2010-2012 Jo-Philipp Wich <xm@subsignal.org>
+# Copyright (C) 2010-2013 Jo-Philipp Wich <xm@subsignal.org>
#
# This is free software, licensed under the GPL 2 license.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libiwinfo
-PKG_RELEASE:=38
+PKG_RELEASE:=39
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_CONFIG_DEPENDS := \
static int iwinfo_ioctl_socket(void)
{
/* Prepare socket */
- if( ioctl_socket == -1 )
+ if (ioctl_socket == -1)
{
ioctl_socket = socket(AF_INET, SOCK_DGRAM, 0);
fcntl(ioctl_socket, F_SETFD, fcntl(ioctl_socket, F_GETFD) | FD_CLOEXEC);
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
- if( iwinfo_ioctl(SIOCGIFFLAGS, &ifr) )
+ if (iwinfo_ioctl(SIOCGIFFLAGS, &ifr))
return 0;
ifr.ifr_flags |= (IFF_UP | IFF_RUNNING);
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
- if( iwinfo_ioctl(SIOCGIFFLAGS, &ifr) )
+ if (iwinfo_ioctl(SIOCGIFFLAGS, &ifr))
return 0;
ifr.ifr_flags &= ~(IFF_UP | IFF_RUNNING);
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
- if( iwinfo_ioctl(SIOCGIFHWADDR, &ifr) )
+ if (iwinfo_ioctl(SIOCGIFHWADDR, &ifr))
return 0;
ifr.ifr_hwaddr.sa_data[1]++;
void iwinfo_close(void)
{
- if( ioctl_socket > -1 )
+ if (ioctl_socket > -1)
close(ioctl_socket);
+
+ ioctl_socket = -1;
}
struct iwinfo_hardware_entry * iwinfo_hardware(struct iwinfo_hardware_id *id)