commit 2e50e6fc057bdf871587693b74cca93bb155acec
parent 328cb02e4dbe909f6fb15390cfedfafd938f2912
Author: Matt Oberle <matt.r.oberle@gmail.com>
Date: Mon, 9 Aug 2021 01:27:26 -0400
hotspot: stat fallback for unknown d_type
Utilize 'storage_is_file' when readdir returns DT_UNKNOWN to ensure
features like autoconnect work on filesystems that don't return a d_type
(eg. XFS).
Diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/hotspot.c b/src/hotspot.c
@@ -495,12 +495,17 @@ static int hotspot_init(void)
char *filename;
struct network_config config;
- if (dirent->d_type != DT_REG && dirent->d_type != DT_LNK)
- continue;
-
filename = l_strdup_printf("%s/%s", hs20_dir, dirent->d_name);
s = l_settings_new();
+ if (dirent->d_type == DT_UNKNOWN) {
+ if (!storage_is_file(filename))
+ goto next;
+ } else if (dirent->d_type != DT_REG &&
+ dirent->d_type != DT_LNK) {
+ goto next;
+ }
+
if (!l_settings_load_from_file(s, filename))
goto next;