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:
parent
387b391d6d
commit
293c8929a7
|
@ -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 ) ;
|
||||
|
||||
|
|
|
@ -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 ;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue