File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -126,13 +126,29 @@ sub check_socket_path_length {
126
126
die " Could not create UNIX domain socket: $! "
127
127
unless defined $sock ;
128
128
129
+ my $hostpath = eval {$sock -> hostpath()};
130
+ if ($@ ) {
131
+ die unless $@ =~ / ^Bad arg length for Socket::unpack_sockaddr_un/ ;
132
+
133
+ # Bug on AIX and i5/OS Perl IO::Socket::UNIX which dies with something
134
+ # like:
135
+ # Bad arg length for Socket::unpack_sockaddr_un, length is 25,
136
+ # should be 106 at /path/to/perl/lib/5.8.0/aix/Socket.pm line 380.
137
+ #
138
+ # Just fake it that everything is fine
139
+ $hostpath = $testfile ;
140
+ }
141
+
129
142
die " UNIX domain socket path was truncated"
130
- unless ($testfile eq $sock -> hostpath() );
143
+ unless ($testfile eq $hostpath );
131
144
132
145
$truncated = 0; # Yes, it worked!
133
146
134
147
};
135
148
149
+ die " Unexpected failure when checking socket path length: $@ "
150
+ if $@ and $@ !~ / ^UNIX domain socket path was truncated/ ;
151
+
136
152
$sock = undef ; # Close socket
137
153
rmtree($tmpdir ); # Remove the tempdir and any socket file created
138
154
return $truncated ;
You can’t perform that action at this time.
0 commit comments