aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2024-02-22 11:02:46 -0500
committerSteven Rostedt (Google) <rostedt@goodmis.org>2024-02-22 11:12:03 -0500
commitba750812f68f0f3314494558496c23f934f8faff (patch)
tree8f3ca60b7610b7884d9fdf8279ea6c8e19196792
parent5f27b7f3fb7d88b29522baf3883cc0e2e28b1af0 (diff)
downloadlibtracefs-ba750812f68f0f3314494558496c23f934f8faff.tar.gz
libtracefs utest: Add PATH_MAX if it is not already defined
In some setups PATH_MAX may not be defined (it is usually defined in linux/limits.h), but we just use PATH_MAX as something to hold the paths to the tracing files. In that case, just define it to 1024 if it's not already defined. Link: https://lore.kernel.org/linux-trace-devel/20240222-utest-fixes-v2-1-7b8ee8dca0b7@gmail.com/ Fixes: 845f16976929 ("libtracefs: Add unit tests") Reported-by: Miko Larsson <mikoxyzzz@gmail.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--utest/tracefs-utest.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c
index 963fac7..07ecd32 100644
--- a/utest/tracefs-utest.c
+++ b/utest/tracefs-utest.c
@@ -26,6 +26,10 @@
#define gettid() syscall(__NR_gettid)
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
#define TRACEFS_SUITE "tracefs library"
#define TEST_INSTANCE_NAME "cunit_test_iter"
#define TEST_TRACE_DIR "/tmp/trace_utest.XXXXXX"