From: Norton T. Allen Date: Thu, 12 Feb 1998 13:40:56 +0000 (-0500) Subject: 5.004_58 QNX getcwd X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7fbf1995491e949f272b62425198e9acc037df4d;p=p5sagit%2Fp5-mst-13.2.git 5.004_58 QNX getcwd p4raw-id: //depot/perl@516 --- diff --git a/hints/qnx.sh b/hints/qnx.sh index 947c98f..7b7c9e6 100644 --- a/hints/qnx.sh +++ b/hints/qnx.sh @@ -36,18 +36,8 @@ # Resolved in 970211 Beta # lib/io_udp.t test hangs because of a bug in getsockname(). # Fixed in latest BETA socket3r.lib -# If there is a softlink in your path, Findbin will fail. -# This is a documented feature of perl's getpwd(). # There is currently no support for dynamically linked # libraries. -# op/magic.t failure due to a feature of QNX which rewrites script -# names before they are executed. I think you'll find that if -# you cd `fullpath -t` before doing the make, the test will pass. -#---------------------------------------------------------------- -# At present, all QNX systems are equivalent architectures, -# so it might be reasonable to call archname=qnx rather than -# making an unnecessary distinction between AT-qnx and PCI-qnx, -# for example. #---------------------------------------------------------------- # These hints were submitted by: # Norton T. Allen @@ -62,6 +52,14 @@ echo "Some tests may fail. Please read the hints/qnx.sh file." echo "" #---------------------------------------------------------------- +# At present, all QNX systems are equivalent architectures, +# so it is reasonable to call archname=x86-qnx rather than +# making an unnecessary distinction between AT-qnx and PCI-qnx, +# for example. +#---------------------------------------------------------------- +archname='x86-qnx' + +#---------------------------------------------------------------- # QNX doesn't come with a csh and the ports of tcsh I've used # don't work reliably: #---------------------------------------------------------------- diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 048842b..19ff497 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -360,6 +360,19 @@ sub _dos_cwd { return $ENV{'PWD'}; } +sub _qnx_cwd { + $ENV{'PWD'} = `/usr/bin/fullpath -t`; + chop $ENV{'PWD'}; + return $ENV{'PWD'}; +} + +sub _qnx_abs_path { + my $path = shift || '.'; + my $realpath=`/usr/bin/fullpath -t $path`; + chop $realpath; + return $realpath; +} + { local $^W = 0; # assignments trigger 'subroutine redefined' warning @@ -394,6 +407,14 @@ sub _dos_cwd { *fastcwd = \&_dos_cwd; *abs_path = \&fast_abs_path; } + elsif ($^O eq 'qnx') { + *cwd = \&_qnx_cwd; + *getcwd = \&_qnx_cwd; + *fastgetcwd = \&_qnx_cwd; + *fastcwd = \&_qnx_cwd; + *abs_path = \&_qnx_abs_path; + *fast_abs_path = \&_qnx_abs_path; + } } # package main; eval join('',) || die $@; # quick test diff --git a/t/op/magic.t b/t/op/magic.t index ace49b5..ab23d84 100755 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -109,7 +109,7 @@ ok 18, $$ > 0, $$; # $^X and $0 { if ($^O eq 'qnx') { - chomp($wd = `pwd`); + chomp($wd = `/usr/bin/fullpath -t`); } else { $wd = '.';