Skip to content

Commit

Permalink
tests: respect $TMPDIR when creating unix domain sockets
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yedayak authored and bagder committed Dec 18, 2023
1 parent 15b09d9 commit ad50d81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/servers.pm
Expand Up @@ -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
Expand Down

0 comments on commit ad50d81

Please sign in to comment.