[gparted] Actually display error message from statvfs() failure



commit 293c8929a7a703f68f1901518a74371a91db6ae2
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sat Sep 14 15:23:49 2013 +0100

    Actually display error message from statvfs() failure
    
    Pass error_message parameter by reference to
    get_mounted_filesystem_usage() so that the caller can access the
    modified error message when required.

 include/Utils.h |    2 +-
 src/Utils.cc    |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/include/Utils.h b/include/Utils.h
index 4b6c96c..f2357aa 100644
--- a/include/Utils.h
+++ b/include/Utils.h
@@ -194,7 +194,7 @@ public:
        static Glib::ustring generate_uuid(void);
        static int get_mounted_filesystem_usage( const Glib::ustring & mountpoint,
                                                 Byte_Value & fs_size, Byte_Value & fs_free,
-                                                Glib::ustring error_message ) ;
+                                                Glib::ustring & error_message ) ;
        static Byte_Value floor_size( Byte_Value value, Byte_Value rounding_size ) ;
        static Byte_Value ceil_size( Byte_Value value, Byte_Value rounding_size ) ;
 
diff --git a/src/Utils.cc b/src/Utils.cc
index e7fcd78..695e3d8 100644
--- a/src/Utils.cc
+++ b/src/Utils.cc
@@ -653,7 +653,7 @@ Glib::ustring Utils::generate_uuid(void)
 //  and free space, both in bytes.
 int Utils::get_mounted_filesystem_usage( const Glib::ustring & mountpoint,
                                          Byte_Value & fs_size, Byte_Value & fs_free,
-                                         Glib::ustring error_message )
+                                         Glib::ustring & error_message )
 {
        struct statvfs sfs ;
        int ret ;
@@ -664,7 +664,7 @@ int Utils::get_mounted_filesystem_usage( const Glib::ustring & mountpoint,
                fs_free = static_cast<Byte_Value>( sfs .f_bfree ) * sfs .f_bsize ;
        }
        else
-               error_message = "statvfs (" + mountpoint + "): " + Glib::strerror( errno ) ;
+               error_message = "statvfs(\"" + mountpoint + "\"): " + Glib::strerror( errno ) ;
 
        return ret ;
 }


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