Re: [PATCH] linux: check the prefix 'wlan' for WiFi device as the last fallback method

On Mon, Dec 05, 2016 at 12:18:15PM +0100, Thomas Haller wrote:
On Mon, 2016-12-05 at 15:37 +0800, Shih-Yuan Lee (FourDollars) wrote:
The sysfs path may not exist due to race conditions while accessing

It's better to check the prefix 'wlan' as the last fallback method.
How about, wifi_utils_is_wifi() gets also an argument ifindex.
Instead of operating on the path name directly, it would first
open("/sys/class/net/wlan0") and then use openat to navigate inside
this directory.

  nmp_utils_open_sysctl(int ifindex, const char *ifname)

This seems a good idea to me.


Attachment: signature.asc
Description: PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]