Change 27699 by rgs@stencil on 2006/04/03 08:57:57
Subject: [PATCH] ext/I/t/io_unix.t
From: Jarkko Hietaniemi <jhietaniemi (AT) gmail (DOT) com>
Date: Sun, 02 Apr 2006 21:57:19 +0300
Message-ID: <44301E8F.2060503 (AT) gmail (DOT) com>
Affected files
//depot/perl/ext/I/t/io_unix.t#4 edit
Differences
//depot/perl/ext/I/t/io_unix.t#4 (text)
Index: perl/ext/I/t/io_unix.t
perl/ext/I/t/io_unix.t#3~27609~2006-03-25 18:49:11.000000000 -0800
perl/ext/I/t/io_unix.t2006-04-03 01:57:57.000000000 -0700
@@ -52,7 +52,26 @@
use I::Socket;
-$listen = I::Socket::UNIX->new(Local=>$PATH, Listen=>0) || die "$!";
+$listen = I::Socket::UNIX->new(Local =$PATH, Listen =0);
+
+# Sometimes UNIX filesystems are mounted for security reasons
+# with "nodev" option which spells out "no" for creating UNIX
+# local sockets. Therefore we will retry with a File::Temp
+# generated filename from a temp directory.
+unless (defined $listen) {
+ eval { require File::Temp };
+ unless ($@) {
+import File::Temp 'mktemp';
+for my $TMPDIR ($ENV{TMPDIR}, "/tmp") {
+ if (defined $TMPDIR && -d $TMPDIR && -w $TMPDIR) {
+$PATH = mktemp("$TMPDIR/sXXXXXXXX");
+last if $listen = I::Socket::UNIX->new(Local =$PATH,
+Listen =0);
+ }
+}
+ }
+ defined $listen or die "$PATH: $!";
+}
print "ok 1\n";
if($pid = fork()) {
End of Patch.