Subject: RE: bug#9078: coreutils8.12: stat.c uses statbuf->st_blksize uncondtionally

From: "Joachim Schmitz" <[email-masked]>
Date: Thu, 14 Jul 2011 14:48:03 +0200

Works for me, thanks!

-----Original Message-----
From: Pádraig Brady [mailto:[email-masked]] 
Sent: Thursday, July 14, 2011 1:59 PM
To: Joachim Schmitz
Cc: [email-masked]
Subject: Re: bug#9078: coreutils8.12: stat.c uses statbuf->st_blksize
uncondtionally

On 14/07/11 08:16, Joachim Schmitz wrote:
> Hi folks
> 
>  
> 
> stat.c uses statbuf->st_blksize uncondtionally and on HP Nonstop 
> struct stat doesn't have this (nor st_blocks).
> 
> Shouldn't it be checking for HAVE_STAT_ST_BLOCKS?

We should probably be doing:

diff --git a/src/stat.c b/src/stat.c
index 0ad465e..fffa97f 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -951,7 +951,7 @@ print_stat (char *pformat, size_t prefix_len, unsigned
int m,
       out_uint (pformat, prefix_len, ST_NBLOCKS (*statbuf));
       break;
     case 'o':
-      out_uint (pformat, prefix_len, statbuf->st_blksize);
+      out_uint (pformat, prefix_len, ST_BLKSIZE(*statbuf));
       break;
     case 'w':
       {

ST_BLKSIZE is defined in:
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/stat-size.h;hb=HEAD

cheers,
Pádraig.