Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: stat on Linux/x86_64 (was: zsh on Opteron (Linux) and limit)



Vincent Lefevre wrote:
> In the Src/Modules/stat.c file:
> 
>     case ST_INO:
> #ifdef INO_T_IS_64_BIT
>         convbase(optr, sbuf->st_ino, 0);
> #else
>         DPUTS(sizeof(sbuf->st_ino) > 4,
>               "Shell compiled with wrong ino_t size");
>         statulprint((unsigned long)sbuf->st_ino, optr);
> #endif
>         break;

Thanks for noticing.

Looks like that debugging test is wrong; presumably sizeof(unsigned
long) is 8 and the error message goes away.  Indeed, != might have been
better than > but I'm too cowardly.

Index: Src/Modules/stat.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/stat.c,v
retrieving revision 1.7
diff -u -r1.7 stat.c
--- Src/Modules/stat.c	2 Jun 2004 22:15:00 -0000	1.7
+++ Src/Modules/stat.c	18 Feb 2005 13:51:26 -0000
@@ -239,7 +239,7 @@
 #ifdef INO_T_IS_64_BIT
 	convbase(optr, sbuf->st_ino, 0);
 #else
-	DPUTS(sizeof(sbuf->st_ino) > 4,
+	DPUTS(sizeof(sbuf->st_ino) > sizeof(unsigned long),
 	      "Shell compiled with wrong ino_t size");
 	statulprint((unsigned long)sbuf->st_ino, optr);
 #endif
@@ -269,7 +269,7 @@
 #ifdef OFF_T_IS_64_BIT
 	convbase(optr, sbuf->st_size, 0);
 #else
-	DPUTS(sizeof(sbuf->st_size) > 4,
+	DPUTS(sizeof(sbuf->st_size) > sizeof(unsigned long),
 	      "Shell compiled with wrong off_t size");
 	statulprint((unsigned long)sbuf->st_size, optr);
 #endif

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author