GNU bug report logs -
#9078
coreutils8.12: stat.c uses statbuf->st_blksize uncondtionally
Previous Next
Full log
View this message in rfc822 format
Works for me, thanks!
-----Original Message-----
From: Pádraig Brady [mailto:P <at> draigBrady.com]
Sent: Thursday, July 14, 2011 1:59 PM
To: Joachim Schmitz
Cc: 9078 <at> debbugs.gnu.org
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.
This bug report was last modified 14 years and 8 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.