mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 08:50:22 +01:00
core: use nm_platform_sysctl_get() to read wifi rfkill value
nm_platform_sysctl_get() adds logging and is our prefered way to read sysfs. Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
bd08198064
commit
cbee213781
1 changed files with 4 additions and 2 deletions
|
|
@ -230,8 +230,10 @@ nm_device_wifi_get_ipw_rfkill_state (NMDeviceWifi *self)
|
|||
const char *str_state = NULL;
|
||||
|
||||
if ( priv->ipw_rfkill_path
|
||||
&& g_file_get_contents (priv->ipw_rfkill_path, &contents, NULL, NULL)) {
|
||||
contents = g_strstrip (contents);
|
||||
&& (contents = nm_platform_sysctl_get (priv->ipw_rfkill_path))) {
|
||||
|
||||
if (strlen (contents) != 1)
|
||||
contents[0] = 0;
|
||||
|
||||
/* 0 - RF kill not enabled
|
||||
* 1 - SW based RF kill active (sysfs)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue