diff mbox series

trace-cmd utest: Add PATH_MAX if it is not already defined

Message ID 20240222110604.156aa6bb@gandalf.local.home (mailing list archive)
State Accepted
Commit 29f29261bf99c71fc429de2803df44908c3dce3e
Headers show
Series trace-cmd utest: Add PATH_MAX if it is not already defined | expand

Commit Message

Steven Rostedt Feb. 22, 2024, 4:06 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

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/

Reported-by: Miko Larsson <mikoxyzzz@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 utest/tracecmd-utest.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/utest/tracecmd-utest.c b/utest/tracecmd-utest.c
index 5dce3e94df6a..164f5da1f06a 100644
--- a/utest/tracecmd-utest.c
+++ b/utest/tracecmd-utest.c
@@ -22,6 +22,10 @@ 
 
 #include "trace-utest.h"
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 static char tracecmd_exec[PATH_MAX];
 
 #define TRACECMD_SUITE		"trace-cmd"