This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.003_15 and Interactive Unix
authorWinfried Koenig <win@in.rhein-main.de>
Wed, 25 Dec 1996 22:45:45 +0000 (00:45 +0200)
committerChip Salzenberg <chip@atlantic.net>
Fri, 27 Dec 1996 18:22:00 +0000 (06:22 +1200)
with my patches, perl5.003_15 compiled with cc, runs all tests.
Compiled with gcc I get this failed tests:

op/goto...........FAILED on test 8
op/sysio..........FAILED on test 0
lib/autoloader....Goto undefined subroutine at ./lib/autoloader.t line 58.
FAILED on test 3
lib/english.......FAILED on test 0
lib/fatal.........FAILED on test 0
lib/hostname......FAILED on test 0
Failed 6/135 tests, 91.11% okay.

On my Linux System I get similar failures:

op/goto...........FAILED on test 8
op/sysio..........Negative length at ./op/sysio.t line 64.
FAILED on test 1
lib/autoloader....Goto undefined subroutine at ./lib/autoloader.t line 58.
FAILED on test 0
lib/english.......FAILED on test 0
lib/fatal.........Can't use an undefined value as filehandle reference at ./lib/fatal.t line 21.
lib/hostname......FAILED on test 0
Failed 6/135 tests, 94.81% okay.

So I think that this problems are already fixed. My changes to
perl.h are necessary to compile x2p/malloc.c, but there may be
better solutions.

p5p-msgid: <m0vd254-0004oKC@incom.rhein-main.de>

hints/isc.sh
pp_sys.c

index 5860acc..43b70fd 100644 (file)
@@ -31,6 +31,9 @@ esac
 # getsockname() and getpeername() return 256 for no good reason
 ccflags="$ccflags -DBOGUS_GETNAME_RETURN=256"
 
+# rename(2) can't rename long filenames
+d_rename=undef
+
 # You can also include -D_SYSV3 to pick up "traditionally visible"
 # symbols hidden by name-space pollution rules.  This raises some
 # compilation "redefinition" warnings, but they appear harmless.
index 72b8df5..10b64d4 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2496,13 +2496,15 @@ PP(pp_rename)
 #ifdef HAS_RENAME
     anum = rename(tmps, tmps2);
 #else
-    if (same_dirent(tmps2, tmps))      /* can always rename to same name */
-       anum = 1;
-    else {
-       if (euid || Stat(tmps2, &statbuf) < 0 || !S_ISDIR(statbuf.st_mode))
-           (void)UNLINK(tmps2);
-       if (!(anum = link(tmps, tmps2)))
-           anum = UNLINK(tmps);
+    if (!(anum = Stat(tmps, &statbuf))) {
+       if (same_dirent(tmps2, tmps))   /* can always rename to same name */
+           anum = 1;
+       else {
+           if (euid || Stat(tmps2, &statbuf) < 0 || !S_ISDIR(statbuf.st_mode))
+               (void)UNLINK(tmps2);
+           if (!(anum = link(tmps, tmps2)))
+               anum = UNLINK(tmps);
+       }
     }
 #endif
     SETi( anum >= 0 );