Skip to content

Commit 09777fd

Browse files
cataphractclaude
andcommitted
Exit with error if temp dir creation fails
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 09e13d6 commit 09777fd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/lib.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ function get_temp_dir() {
55
if (!$dir) {
66
$dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR
77
. 'phpla_' . getmypid() . '_' . uniqid();
8-
mkdir($dir, 0700);
8+
if (!mkdir($dir, 0700)) {
9+
exit("Could not create temp dir: $dir\n");
10+
}
911

1012
register_shutdown_function(function() use ($dir) {
1113
$files = new RecursiveIteratorIterator(

0 commit comments

Comments
 (0)