diff mbox series

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

Message ID 20240325115034.643892-4-pvorel@suse.cz
State Changes Requested
Headers show
Series Remove double or trailing slashes in TMPDIR in C API | expand

Commit Message

Petr Vorel March 25, 2024, 11:50 a.m. UTC
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 mbox series

Patch

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