]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: respect $TMPDIR when creating unix domain sockets
authorYedaya Katsman <yedaya.ka@gmail.com>
Sun, 17 Dec 2023 20:04:25 +0000 (22:04 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 Dec 2023 07:29:58 +0000 (08:29 +0100)
When running on termux, where $TMPDIR isn't /tmp, running the tests
failed, since the server config tried creating sockets in /tmp, without
checking the temp dir config. Use the TMPDIR variable that makes it find
the correct directory everywhere [0]

[0] https://perldoc.perl.org/File::Temp#tempfile

Closes #12545

tests/servers.pm

index 9416ba75884227e76b09f5f177275538e1974e23..d4472d509bd9b2f248896d8f257633358960eb73 100644 (file)
@@ -190,10 +190,10 @@ use File::Temp qw/ tempfile/;
 #######################################################################
 # Initialize configuration variables
 sub initserverconfig {
-    my ($fh, $socks) = tempfile("/tmp/curl-socksd-XXXXXXXX");
+    my ($fh, $socks) = tempfile("curl-socksd-XXXXXXXX", TMPDIR => 1);
     close($fh);
     unlink($socks);
-    my ($f2, $http) = tempfile("/tmp/curl-http-XXXXXXXX");
+    my ($f2, $http) = tempfile("curl-http-XXXXXXXX", TMPDIR => 1);
     close($f2);
     unlink($http);
     $SOCKSUNIXPATH = $socks; # SOCKS Unix domain socket