From 6b0db6fa746c3d5e2273cf76b6f7544f3a6585fe Mon Sep 17 00:00:00 2001 From: Carter Li Date: Sat, 3 Aug 2024 22:16:07 +0800 Subject: [PATCH] Wifi (Linux): fix compiling without dbus --- src/detection/wifi/wifi_linux.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/detection/wifi/wifi_linux.c b/src/detection/wifi/wifi_linux.c index 95a81325d..1848c236d 100644 --- a/src/detection/wifi/wifi_linux.c +++ b/src/detection/wifi/wifi_linux.c @@ -4,9 +4,9 @@ #include "common/properties.h" #include "util/stringUtils.h" -#include -#include +#include +#ifdef FF_HAVE_DBUS // https://people.freedesktop.org/~lkundrak/nm-docs/nm-dbus-types.html#NM80211ApFlags typedef enum { NM_802_11_AP_FLAGS_NONE = 0x00000000, @@ -118,6 +118,7 @@ static const char* detectWifiWithNm(FFWifiResult* item, FFstrbuf* buffer) return NULL; } +#endif // FF_HAVE_DBUS static const char* detectWifiWithIw(FFWifiResult* item, FFstrbuf* buffer) { @@ -178,7 +179,6 @@ static const char* detectWifiWithIw(FFWifiResult* item, FFstrbuf* buffer) #if FF_HAVE_LINUX_WIRELESS #include "common/io/io.h" -#include #include #include #include @@ -263,8 +263,7 @@ static const char* detectWifiWithIoctls(FFWifiResult* item) return NULL; } - -#endif +#endif // FF_HAVE_LINUX_WIRELESS const char* ffDetectWifi(FF_MAYBE_UNUSED FFlist* result) { @@ -307,7 +306,9 @@ const char* ffDetectWifi(FF_MAYBE_UNUSED FFlist* result) #endif } - detectWifiWithNm(item, &buffer); + #ifdef FF_HAVE_DBUS + detectWifiWithNm(item, &buffer); + #endif } if_freenameindex(infs);