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.
This commit is contained in:
Mike Fleetwood 2013-09-14 15:23:49 +01:00 committed by Curtis Gedak
parent 387b391d6d
commit 293c8929a7
2 changed files with 3 additions and 3 deletions

View File

@ -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 ) ;

View File

@ -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 ;
}