Ticket #2337: inode-count-block-count.patch

File inode-count-block-count.patch, 976 bytes (added by swegener, 9 years ago)

This correctly prevents division by zero.

  • src/info.c

    From f93b874fe25e14f972b5b81b29c2617e231c4f80 Mon Sep 17 00:00:00 2001
    From: Sven Wegener <sven.wegener@stealer.net>
    Date: Thu, 13 May 2010 00:12:14 +0200
    Subject: [PATCH] Check for inode count instead of block count
    
    This correctly prevents division by zero.
    
    Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
    ---
     src/info.c |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/src/info.c b/src/info.c
    index 4d82a59..bc1d317 100644
    a b info_show_info (struct WInfo *info) 
    127127        if (myfs_stats.nfree > 0 || myfs_stats.nodes > 0) 
    128128            tty_printf (_("Free nodes: %ld (%ld%%) of %ld"), 
    129129                        (size_t) myfs_stats.nfree, 
    130                         myfs_stats.total != 0 
     130                        myfs_stats.nodes != 0 
    131131                        ? 100 * (size_t) myfs_stats.nfree / (size_t) myfs_stats.nodes : 0, 
    132132                        (size_t) myfs_stats.nodes); 
    133133        else