bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Pádraig Brady
Subject: bug#9078: coreutils8.12: stat.c uses statbuf->st_blksize uncondtionally
Date: Thu, 14 Jul 2011 12:58:55 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]