use realpath() to get absolute path to 'real' /etc/mtab. unmount if
* src/Utils.cc: use realpath() to get absolute path to 'real' /etc/mtab. unmount if something went wrong while adding the line to '/etc/mtab' * src/Dialog_Progress.cc: replaced PACK_SHRINK with PACK_EXPAND_WIDGET
This commit is contained in:
parent
e8a628ada4
commit
669f0654d8
|
@ -1,3 +1,10 @@
|
||||||
|
2006-01-24 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||||
|
|
||||||
|
* src/Utils.cc: use realpath() to get absolute path to 'real'
|
||||||
|
/etc/mtab.
|
||||||
|
unmount if something went wrong while adding the line to '/etc/mtab'
|
||||||
|
* src/Dialog_Progress.cc: replaced PACK_SHRINK with PACK_EXPAND_WIDGET
|
||||||
|
|
||||||
2006-01-24 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
2006-01-24 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||||
|
|
||||||
* src/GParted_Core.cc: swapped 'line' and 'c_str' to make
|
* src/GParted_Core.cc: swapped 'line' and 'c_str' to make
|
||||||
|
|
|
@ -88,7 +88,7 @@ Dialog_Progress::Dialog_Progress( const std::vector<Operation> & operations )
|
||||||
expander_details .set_use_markup( true ) ;
|
expander_details .set_use_markup( true ) ;
|
||||||
expander_details .add( scrolledwindow ) ;
|
expander_details .add( scrolledwindow ) ;
|
||||||
|
|
||||||
this ->get_vbox() ->pack_start( expander_details, Gtk::PACK_SHRINK ) ;
|
this ->get_vbox() ->pack_start( expander_details, Gtk::PACK_EXPAND_WIDGET ) ;
|
||||||
this ->get_vbox() ->set_spacing( 5 ) ;
|
this ->get_vbox() ->set_spacing( 5 ) ;
|
||||||
|
|
||||||
this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_NONE ) ;
|
this ->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_NONE ) ;
|
||||||
|
|
10
src/Utils.cc
10
src/Utils.cc
|
@ -166,7 +166,11 @@ bool Utils::mount( const Glib::ustring & node,
|
||||||
//append 'line' to /etc/mtab
|
//append 'line' to /etc/mtab
|
||||||
if ( hit )
|
if ( hit )
|
||||||
{
|
{
|
||||||
std::ofstream mtab( "/etc/mtab", std::ios::app ) ;
|
//in some situations (some livecd's e.g.) /etc/mtab is a (sym)link.
|
||||||
|
char real_path[255] ;
|
||||||
|
if ( realpath( "/etc/mtab", real_path ) )
|
||||||
|
{
|
||||||
|
std::ofstream mtab( real_path, std::ios::app ) ;
|
||||||
|
|
||||||
if ( mtab )
|
if ( mtab )
|
||||||
{
|
{
|
||||||
|
@ -177,6 +181,10 @@ bool Utils::mount( const Glib::ustring & node,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//something went wrong while adding the line to mtab
|
||||||
|
umount( mountpoint .c_str() ) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
error = Glib::strerror( errno ) ;
|
error = Glib::strerror( errno ) ;
|
||||||
|
|
Loading…
Reference in New Issue