* [LTP] [PATCH] read_all: Define FNM_EXTMATCH if not already (like under musl).
@ 2018-06-25 15:18 Daniel =?unknown-8bit?q?D=C3=ADaz?=
2018-07-23 13:01 ` Petr Vorel
0 siblings, 1 reply; 4+ messages in thread
From: Daniel =?unknown-8bit?q?D=C3=ADaz?= @ 2018-06-25 15:18 UTC (permalink / raw)
To: ltp
With musl, FNM_EXTMATCH is not defined:
| read_all.c: In function 'read_test':
| read_all.c:201:41: error: 'FNM_EXTMATCH' undeclared (first use in this function); did you mean 'FNM_NOMATCH'?
| if (exclude && !fnmatch(exclude, path, FNM_EXTMATCH)) {
| ^~~~~~~~~~~~
| FNM_NOMATCH
| read_all.c:201:41: note: each undeclared identifier is reported only once for each function it appears in
| <builtin>: recipe for target 'read_all' failed
| make[4]: *** [read_all] Error 1
Signed-off-by: Daniel DÃaz <daniel.diaz@linaro.org>
---
testcases/kernel/fs/read_all/read_all.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c
index 42babae..f68217b 100644
--- a/testcases/kernel/fs/read_all/read_all.c
+++ b/testcases/kernel/fs/read_all/read_all.c
@@ -60,6 +60,10 @@
#define MAX_PATH 4096
#define MAX_DISPLAY 40
+#if !defined(FNM_EXTMATCH)
+#define FNM_EXTMATCH 0
+#endif
+
struct queue {
sem_t sem;
int front;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [LTP] [PATCH] read_all: Define FNM_EXTMATCH if not already (like under musl).
2018-06-25 15:18 [LTP] [PATCH] read_all: Define FNM_EXTMATCH if not already (like under musl) Daniel =?unknown-8bit?q?D=C3=ADaz?=
@ 2018-07-23 13:01 ` Petr Vorel
2018-08-28 17:16 ` [LTP] [PATCH v2] fs/read_all: define FNM_EXTMATCH if needed Rafael David Tinoco
0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2018-07-23 13:01 UTC (permalink / raw)
To: ltp
Hi Daniel,
> With musl, FNM_EXTMATCH is not defined:
> | read_all.c: In function 'read_test':
> | read_all.c:201:41: error: 'FNM_EXTMATCH' undeclared (first use in this function); did you mean 'FNM_NOMATCH'?
> | if (exclude && !fnmatch(exclude, path, FNM_EXTMATCH)) {
> | ^~~~~~~~~~~~
> | FNM_NOMATCH
> | read_all.c:201:41: note: each undeclared identifier is reported only once for each function it appears in
> | <builtin>: recipe for target 'read_all' failed
> | make[4]: *** [read_all] Error 1
> Signed-off-by: Daniel DÃaz <daniel.diaz@linaro.org>
> ---
> testcases/kernel/fs/read_all/read_all.c | 4 ++++
> 1 file changed, 4 insertions(+)
> diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c
> index 42babae..f68217b 100644
> --- a/testcases/kernel/fs/read_all/read_all.c
> +++ b/testcases/kernel/fs/read_all/read_all.c
> @@ -60,6 +60,10 @@
> #define MAX_PATH 4096
> #define MAX_DISPLAY 40
> +#if !defined(FNM_EXTMATCH)
Maybe just
#ifndef FNM_EXTMATCH
And maybe it'd be good to put this definition into include/lapi/fnmatch.h
(create it), so it can be reused.
FYI: LTP isn't musl ready atm.
> +#define FNM_EXTMATCH 0
> +#endif
> +
> struct queue {
> sem_t sem;
> int front;
Kind regards,
Petr
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH v2] fs/read_all: define FNM_EXTMATCH if needed
2018-07-23 13:01 ` Petr Vorel
@ 2018-08-28 17:16 ` Rafael David Tinoco
2018-08-30 15:31 ` Cyril Hrubis
0 siblings, 1 reply; 4+ messages in thread
From: Rafael David Tinoco @ 2018-08-28 17:16 UTC (permalink / raw)
To: ltp
FNM_EXTMATCH is not defined in musl libc:
| read_all.c: In function 'read_test':
| read_all.c:201:41: error: 'FNM_EXTMATCH' undeclared (first use in this function); did you mean 'FNM_NOMATCH'?
| if (exclude && !fnmatch(exclude, path, FNM_EXTMATCH)) {
| ^~~~~~~~~~~~
| FNM_NOMATCH
| read_all.c:201:41: note: each undeclared identifier is reported only once for each function it appears in
| <builtin>: recipe for target 'read_all' failed
| make[4]: *** [read_all] Error 1
Even not being 100% musl ready at the moment, this seems a trivial fix
to allow LTP to be built with musl libc.
Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org>
Tested-by: Daniel Díaz <daniel.diaz@linaro.org>
---
include/lapi/fnmatch.h | 14 ++++++++++++++
testcases/kernel/fs/read_all/read_all.c | 1 +
2 files changed, 15 insertions(+)
create mode 100644 include/lapi/fnmatch.h
diff --git a/include/lapi/fnmatch.h b/include/lapi/fnmatch.h
new file mode 100644
index 000000000..9628ac440
--- /dev/null
+++ b/include/lapi/fnmatch.h
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+
+#ifndef FNMATCH_H__
+#define FNMATCH_H__
+
+#ifndef FNM_EXTMATCH
+#define FNM_EXTMATCH 0
+#endif
+
+#endif
diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c
index ac463dba9..1f0b315a1 100644
--- a/testcases/kernel/fs/read_all/read_all.c
+++ b/testcases/kernel/fs/read_all/read_all.c
@@ -40,6 +40,7 @@
*/
#include <sys/types.h>
#include <sys/stat.h>
+#include <lapi/fnmatch.h>
#include <stdlib.h>
#include <stdio.h>
#include <dirent.h>
--
2.18.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [LTP] [PATCH v2] fs/read_all: define FNM_EXTMATCH if needed
2018-08-28 17:16 ` [LTP] [PATCH v2] fs/read_all: define FNM_EXTMATCH if needed Rafael David Tinoco
@ 2018-08-30 15:31 ` Cyril Hrubis
0 siblings, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2018-08-30 15:31 UTC (permalink / raw)
To: ltp
Hi!
Pushed, thanks.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-30 15:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-25 15:18 [LTP] [PATCH] read_all: Define FNM_EXTMATCH if not already (like under musl) Daniel =?unknown-8bit?q?D=C3=ADaz?=
2018-07-23 13:01 ` Petr Vorel
2018-08-28 17:16 ` [LTP] [PATCH v2] fs/read_all: define FNM_EXTMATCH if needed Rafael David Tinoco
2018-08-30 15:31 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox