Skip to content

Commit b277e76

Browse files
committed
Implement symlink(), lstat() and readlink() on Win32
2 parents c1ec4bd + 0d2c9ba commit b277e76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1807
-706
lines changed

MANIFEST

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6164,6 +6164,8 @@ t/win32/fs.t Test Win32 link for compatibility
61646164
t/win32/popen.t Test for stdout races in backticks, etc
61656165
t/win32/runenv.t Test if Win* perl honors its env variables
61666166
t/win32/signal.t Test Win32 signal emulation
6167+
t/win32/stat.t Test Win32 stat emulation
6168+
t/win32/symlink.t Test Win32 symlink
61676169
t/win32/system.t See if system works in Win*
61686170
t/win32/system_tests Test runner for system.t
61696171
taint.c Tainting code

Porting/Maintainers.pl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,11 @@ package Maintainers;
10811081
t/lib/if.pm
10821082
),
10831083
],
1084+
'CUSTOMIZED' => [
1085+
# https://github.com/Perl-Toolchain-Gang/Test-Harness/pull/103
1086+
# applied but not released
1087+
't/source.t'
1088+
],
10841089
},
10851090

10861091
'Test::Simple' => {

cpan/Test-Harness/t/source.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,12 @@ SKIP: {
242242
my $symlink = File::Spec->catfile( $dir, 'source_link.T' );
243243
my $source = TAP::Parser::Source->new;
244244
245-
eval { symlink( File::Spec->rel2abs($test), $symlink ) };
245+
my $did_symlink = eval { symlink( File::Spec->rel2abs($test), $symlink ) };
246246
if ( my $e = $@ ) {
247247
diag($@);
248248
die "aborting test";
249249
}
250+
skip "symlink not successful: $!", 9 unless $did_symlink;
250251
251252
$source->raw( \$symlink );
252253
my $meta = $source->assemble_meta;

dist/PathTools/Cwd.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use strict;
33
use Exporter;
44

55

6-
our $VERSION = '3.79';
6+
our $VERSION = '3.80';
77
my $xs_version = $VERSION;
88
$VERSION =~ tr/_//d;
99

dist/PathTools/Cwd.xs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ bsd_realpath(const char *path, char resolved[MAXPATHLEN])
8484
unsigned symlinks;
8585
int serrno;
8686
char remaining[MAXPATHLEN], next_token[MAXPATHLEN];
87+
#ifdef PERL_IMPLICIT_SYS
88+
dTHX;
89+
#endif
8790

8891
serrno = errno;
8992
symlinks = 0;
@@ -175,8 +178,8 @@ bsd_realpath(const char *path, char resolved[MAXPATHLEN])
175178
}
176179
#if defined(HAS_LSTAT) && defined(HAS_READLINK) && defined(HAS_SYMLINK)
177180
{
178-
struct stat sb;
179-
if (lstat(resolved, &sb) != 0) {
181+
Stat_t sb;
182+
if (PerlLIO_lstat(resolved, &sb) != 0) {
180183
if (errno == ENOENT && p == NULL) {
181184
errno = serrno;
182185
return (resolved);
@@ -191,7 +194,7 @@ bsd_realpath(const char *path, char resolved[MAXPATHLEN])
191194
errno = ELOOP;
192195
return (NULL);
193196
}
194-
slen = readlink(resolved, symlink, sizeof(symlink) - 1);
197+
slen = PerlLIO_readlink(resolved, symlink, sizeof(symlink) - 1);
195198
if (slen < 0)
196199
return (NULL);
197200
symlink[slen] = '\0';

dist/PathTools/lib/File/Spec.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package File::Spec;
22

33
use strict;
44

5-
our $VERSION = '3.79';
5+
our $VERSION = '3.80';
66
$VERSION =~ tr/_//d;
77

88
my %module = (

dist/PathTools/lib/File/Spec/AmigaOS.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package File::Spec::AmigaOS;
33
use strict;
44
require File::Spec::Unix;
55

6-
our $VERSION = '3.79';
6+
our $VERSION = '3.80';
77
$VERSION =~ tr/_//d;
88

99
our @ISA = qw(File::Spec::Unix);

dist/PathTools/lib/File/Spec/Cygwin.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package File::Spec::Cygwin;
33
use strict;
44
require File::Spec::Unix;
55

6-
our $VERSION = '3.79';
6+
our $VERSION = '3.80';
77
$VERSION =~ tr/_//d;
88

99
our @ISA = qw(File::Spec::Unix);

dist/PathTools/lib/File/Spec/Epoc.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package File::Spec::Epoc;
22

33
use strict;
44

5-
our $VERSION = '3.79';
5+
our $VERSION = '3.80';
66
$VERSION =~ tr/_//d;
77

88
require File::Spec::Unix;

dist/PathTools/lib/File/Spec/Functions.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package File::Spec::Functions;
33
use File::Spec;
44
use strict;
55

6-
our $VERSION = '3.79';
6+
our $VERSION = '3.80';
77
$VERSION =~ tr/_//d;
88

99
require Exporter;

0 commit comments

Comments
 (0)