[LTP] [PATCH v2 3/3] lib: Improve doc related to $TMPDIR default value

Petr Vorel pvorel@suse.cz
Mon Mar 25 12:50:34 CET 2024


Link C and shell API related parts to $TMPDIR.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/tst_defaults.h    | 3 ++-
 testcases/lib/tst_test.sh | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/tst_defaults.h b/include/tst_defaults.h
index 083427b7e..abe1e6956 100644
--- a/include/tst_defaults.h
+++ b/include/tst_defaults.h
@@ -8,8 +8,9 @@
 
 /*
  * This is the default temporary directory used by tst_tmpdir().
+ * used when TMPDIR env variable is not set.
  *
- * This is used when TMPDIR env variable is not set.
+ * If changed, update also shell API in testcases/lib/tst_test.sh.
  */
 #define TEMPDIR	"/tmp"
 
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 0d2fccb95..b595bb5ea 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -734,6 +734,8 @@ tst_run()
 
 	if [ "$TST_NEEDS_TMPDIR" = 1 ]; then
 		if [ -z "$TMPDIR" ]; then
+			# Default value if TMPDIR not set.
+			# If changed, update also C API in tst_defaults.h.
 			export TMPDIR="/tmp"
 		fi
 
-- 
2.43.0



More information about the ltp mailing list