It is now less likely to fail if one runs stat.t manually when tests
are running, due to the random file name. It also works now when the
script chdirs (when run outside t), because it no longer relies on $0
being a real file.
That last part was broken by commit
ad2d99e39, which made -T _ more
consistent when it cannot open the file. It used to set the stat
type, but not the success status (as of commit
25988e07, which
fixed #4253).
# bug id 20020124.004
# If we have d_lstat, we should have symlink()
- my $linkname = 'dolzero';
- symlink $0, $linkname or die "# Can't symlink $0: $!";
+ my $linkname = 'stat-' . rand =~ y/.//cdr;
+ symlink $Perl, $linkname or die "# Can't symlink $0: $!";
lstat $linkname;
-T _;
eval { lstat _ };