1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
From 3109c91234f71966d9488aedb285746ef12b44fd Mon Sep 17 00:00:00 2001
From: Olliver Schinagl <oliver@schinagl.nl>
Date: Mon, 4 Mar 2019 07:34:19 +0100
Subject: [PATCH] Remove GLOB_ONLYDIR for musl
The GNU specific flag to glob 'GLOB_ONLYDIR' is a hint for glob that the
caller is only interested in directories, and so glob can do some
internal performance optimizations. It does NOT mean glob WILL only
return directories, the caller is still responsible for checking this.
As musl does not support this GNU extension, lets just remove it.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
core-cache.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core-cache.c b/core-cache.c
index 7fe4a354..52411f84 100644
--- a/core-cache.c
+++ b/core-cache.c
@@ -465,7 +465,7 @@ static int get_cpu_cache_details(cpu_t *cpu, const char *cpu_path)
(void)strncat(glob_path, GLOB_PATTERN_INDEX_PREFIX,
sizeof(glob_path) - len - 1);
- ret2 = glob(glob_path, GLOB_ONLYDIR, NULL, &globbuf);
+ ret2 = glob(glob_path, 0, NULL, &globbuf);
if (ret2 != 0) {
if (warn_once(WARN_ONCE_NO_CACHE))
pr_err("glob on regex \"%s\" failed: %d\n",
@@ -535,7 +535,7 @@ cpus_t * get_all_cpu_cache_details(void)
return NULL;
}
- ret = glob(GLOB_PATTERN, GLOB_ONLYDIR, NULL, &globbuf);
+ ret = glob(GLOB_PATTERN, 0, NULL, &globbuf);
if (ret != 0) {
pr_err("glob on regex \"%s\" failed: %d\n",
GLOB_PATTERN, ret);
--
2.20.1
|