GNU bug report logs - #16539
df command, possible bug?

Previous Next

Package: coreutils;

Reported by: crubel <at> compro.net

Date: Fri, 24 Jan 2014 20:39:01 UTC

Severity: normal

Done: Bernhard Voelker <mail <at> bernhard-voelker.de>

Bug is archived. No further changes may be made.

Full log


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

From: Pádraig Brady <P <at> draigBrady.com>
To: Bernhard Voelker <mail <at> bernhard-voelker.de>
Cc: 16539 <at> debbugs.gnu.org
Subject: Re: bug#16539: More details on df command output for you
Date: Wed, 25 Jun 2014 09:54:15 +0100
On 06/25/2014 09:35 AM, Bernhard Voelker wrote:
> On 06/24/2014 06:36 PM, Pádraig Brady wrote:
>> Fingers crossed this is the last df issue.
> 
> +1
> 
>> df is getting quite messy and could do with a refactoring
>> to use prepopulate hashes from /proc/self/mountinfo,
>> but not for this iteration at least.
> 
> Good idea. Maybe we should wait for user feedback (with yet
> other strange test cases) anyway.
> 
> The patch looks perfect, thanks!

I submitted a slightly stale patch to the list.
The one I'll push now has this change.

diff --git a/src/df.c b/src/df.c
index 25a6df5..063cabf 100644
--- a/src/df.c
+++ b/src/df.c
@@ -1168,7 +1168,7 @@ get_disk (char const *disk)
       if (STREQ (disk, devname))
         {
           char *last_device = last_device_for_mount (me->me_mountdir);
-          eclipsed_device = ! STREQ (last_device, devname);
+          eclipsed_device = last_device && ! STREQ (last_device, devname);
           size_t len = strlen (me->me_mountdir);

           if (! eclipsed_device

thanks,
Pádraig.





This bug report was last modified 10 years and 333 days ago.

Previous Next


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