Skip to content

Commit e3ba207

Browse files
committed
Workaround for /tmp/ directory not existing in testing environment
1 parent e79a635 commit e3ba207

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

winsup/testsuite/libltp/lib/tst_tmpdir.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ tst_tmpdir()
136136
tst_brkm(TBROK, tmpdir_cleanup, "%s: tempnam(%s, %s) failed",
137137
FN_NAME, TEMPDIR, prefix);
138138

139+
struct stat st;
140+
if ( stat(P_tmpdir, &st) != 0 || !S_ISDIR(st.st_mode) )
141+
if ( mkdir(P_tmpdir, DIR_MODE) == -1 )
142+
tst_brkm(TBROK, tmpdir_cleanup,
143+
"%s: mkdir(%s, %#o) failed; errno = %d: %s",
144+
FN_NAME, P_tmpdir, DIR_MODE, errno, strerror(errno));
145+
139146
/*
140147
* Create the temporary directory.
141148
*/

0 commit comments

Comments
 (0)