diff mbox series

[4/4] lib: Improve doc related to $TMPDIR default value

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

Commit Message

Petr Vorel Feb. 7, 2024, 4:06 p.m. UTC
Link C and shell API related parts to $TMPDIR.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/tst_defaults.h    | 5 +++--
 testcases/lib/tst_test.sh | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/tst_defaults.h b/include/tst_defaults.h
index 083427b7e..e3eb6f587 100644
--- a/include/tst_defaults.h
+++ b/include/tst_defaults.h
@@ -7,9 +7,10 @@ 
 #define TST_DEFAULTS_H_
 
 /*
- * This is the default temporary directory used by tst_tmpdir().
+ * 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 tst_test.sh.
  */
 #define TEMPDIR	"/tmp"
 
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 20bf21660..760a49061 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -735,6 +735,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.
 			_tst_tmpdir="/tmp"
 			export TMPDIR="$_tst_tmpdir"
 		else