This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[rt #84590] try to preserve the inode number, even if it's large
authorTony Cook <tony@develop-help.com>
Wed, 27 Jul 2011 11:32:37 +0000 (21:32 +1000)
committerTony Cook <tony@develop-help.com>
Mon, 1 Aug 2011 11:09:26 +0000 (21:09 +1000)
This matches the checks done for other stat() fields.

pp_sys.c

index 726be76..a6949a9 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2834,7 +2834,15 @@ PP(pp_stat)
        EXTEND(SP, max);
        EXTEND_MORTAL(max);
        mPUSHi(PL_statcache.st_dev);
+#if ST_INO_SIZE > IVSIZE
+       mPUSHn(PL_statcache.st_ino);
+#else
+#   if ST_INO_SIGN <= 0
        mPUSHi(PL_statcache.st_ino);
+#   else
+       mPUSHu(PL_statcache.st_ino);
+#   endif
+#endif
        mPUSHu(PL_statcache.st_mode);
        mPUSHu(PL_statcache.st_nlink);
 #if Uid_t_size > IVSIZE