0002-libtracefs-utest-Add-PATH_MAX-if-it-is-not-already-defined.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From ba750812f68f0f3314494558496c23f934f8faff Mon Sep 17 00:00:00 2001
  2. From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
  3. Date: Thu, 22 Feb 2024 11:02:46 -0500
  4. Subject: libtracefs utest: Add PATH_MAX if it is not already defined
  5. In some setups PATH_MAX may not be defined (it is usually defined in
  6. linux/limits.h), but we just use PATH_MAX as something to hold the paths
  7. to the tracing files. In that case, just define it to 1024 if it's not
  8. already defined.
  9. Link: https://lore.kernel.org/linux-trace-devel/20240222-utest-fixes-v2-1-7b8ee8dca0b7@gmail.com/
  10. Fixes: 845f16976929 ("libtracefs: Add unit tests")
  11. Reported-by: Miko Larsson <mikoxyzzz@gmail.com>
  12. Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
  13. Upstream: https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/commit/?id=ba750812f68f0f3314494558496c23f934f8faff
  14. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  15. ---
  16. utest/tracefs-utest.c | 4 ++++
  17. 1 file changed, 4 insertions(+)
  18. diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c
  19. index 963fac7..07ecd32 100644
  20. --- a/utest/tracefs-utest.c
  21. +++ b/utest/tracefs-utest.c
  22. @@ -26,6 +26,10 @@
  23. #define gettid() syscall(__NR_gettid)
  24. +#ifndef PATH_MAX
  25. +#define PATH_MAX 1024
  26. +#endif
  27. +
  28. #define TRACEFS_SUITE "tracefs library"
  29. #define TEST_INSTANCE_NAME "cunit_test_iter"
  30. #define TEST_TRACE_DIR "/tmp/trace_utest.XXXXXX"
  31. --
  32. cgit 1.2.3-korg