Changeset 35471


Ignore:
Timestamp:
2013-02-03T13:03:24+01:00 (5 years ago)
Author:
jow
Message:

libiwinfo: reset ioctl_socket fd in iwinfo_close(), fixes random failures with multiple cycles of iwinfo_finish() / iwinfo_backend()

Location:
trunk/package/network/utils/iwinfo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/network/utils/iwinfo/Makefile

    r35007 r35471  
    11# 
    2 # Copyright (C) 2010-2012 Jo-Philipp Wich <xm@subsignal.org> 
     2# Copyright (C) 2010-2013 Jo-Philipp Wich <xm@subsignal.org> 
    33# 
    44# This is free software, licensed under the GPL 2 license. 
     
    88 
    99PKG_NAME:=libiwinfo 
    10 PKG_RELEASE:=38 
     10PKG_RELEASE:=39 
    1111 
    1212PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) 
  • trunk/package/network/utils/iwinfo/src/iwinfo_utils.c

    r33199 r35471  
    2929{ 
    3030        /* Prepare socket */ 
    31         if( ioctl_socket == -1 ) 
     31        if (ioctl_socket == -1) 
    3232        { 
    3333                ioctl_socket = socket(AF_INET, SOCK_DGRAM, 0); 
     
    8383        strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 
    8484 
    85         if( iwinfo_ioctl(SIOCGIFFLAGS, &ifr) ) 
     85        if (iwinfo_ioctl(SIOCGIFFLAGS, &ifr)) 
    8686                return 0; 
    8787 
     
    9797        strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 
    9898 
    99         if( iwinfo_ioctl(SIOCGIFFLAGS, &ifr) ) 
     99        if (iwinfo_ioctl(SIOCGIFFLAGS, &ifr)) 
    100100                return 0; 
    101101 
     
    111111        strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 
    112112 
    113         if( iwinfo_ioctl(SIOCGIFHWADDR, &ifr) ) 
     113        if (iwinfo_ioctl(SIOCGIFHWADDR, &ifr)) 
    114114                return 0; 
    115115 
     
    122122void iwinfo_close(void) 
    123123{ 
    124         if( ioctl_socket > -1 ) 
     124        if (ioctl_socket > -1) 
    125125                close(ioctl_socket); 
     126 
     127        ioctl_socket = -1; 
    126128} 
    127129 
Note: See TracChangeset for help on using the changeset viewer.