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

Previous Next

Package: coreutils;

Reported by: "Joachim Schmitz" <jojo <at> schmitz-digital.de>

Date: Thu, 14 Jul 2011 07:17:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9078 in the body.
You can then email your comments to 9078 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#9078; Package coreutils. (Thu, 14 Jul 2011 07:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Joachim Schmitz" <jojo <at> schmitz-digital.de>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 14 Jul 2011 07:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Joachim Schmitz" <jojo <at> schmitz-digital.de>
To: <bug-coreutils <at> gnu.org>
Subject: coreutils8.12: stat.c uses statbuf->st_blksize uncondtionally
Date: Thu, 14 Jul 2011 09:16:33 +0200
[Message part 1 (text/plain, inline)]
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?

 

Bye, Jojo

[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#9078; Package coreutils. (Thu, 14 Jul 2011 12:01:01 GMT) Full text and rfc822 format available.

Message #8 received at 9078 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Joachim Schmitz <jojo <at> schmitz-digital.de>
Cc: 9078 <at> debbugs.gnu.org
Subject: Re: bug#9078: coreutils8.12: stat.c uses
	statbuf->st_blksize	uncondtionally
Date: Thu, 14 Jul 2011 12:58:55 +0100
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.




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#9078; Package coreutils. (Thu, 14 Jul 2011 12:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 9078 <at> debbugs.gnu.org (full text, mbox):

From: "Joachim Schmitz" <jojo <at> schmitz-digital.de>
To: 'Pádraig Brady' <P <at> draigBrady.com>
Cc: 9078 <at> debbugs.gnu.org
Subject: RE: bug#9078: coreutils8.12: stat.c uses
	statbuf->st_blksize	uncondtionally
Date: Thu, 14 Jul 2011 14:48:03 +0200
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.





Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Fri, 15 Jul 2011 15:27:05 GMT) Full text and rfc822 format available.

Notification sent to "Joachim Schmitz" <jojo <at> schmitz-digital.de>:
bug acknowledged by developer. (Fri, 15 Jul 2011 15:27:05 GMT) Full text and rfc822 format available.

Message #16 received at 9078-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Joachim Schmitz <jojo <at> schmitz-digital.de>
Cc: 9078-done <at> debbugs.gnu.org
Subject: Re: bug#9078: coreutils8.12: stat.c uses
	statbuf->st_blksize	uncondtionally
Date: Fri, 15 Jul 2011 16:23:13 +0100
On 14/07/11 13:48, Joachim Schmitz wrote:
> Works for me, thanks!

pushed.

thanks again,
Pádraig.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 13 Aug 2011 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.