[gparted] Enhance to try udevadm if udevsettle is not found
- From: Curtis Gedak <gedakc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gparted] Enhance to try udevadm if udevsettle is not found
- Date: Fri, 24 Apr 2009 13:28:55 -0400 (EDT)
commit a05751ea952724a6bcbf0adffd67c34ac1f08bfa
Author: Curtis Gedak <gedakc gmail com>
Date: Fri Apr 24 11:12:29 2009 -0600
Enhance to try udevadm if udevsettle is not found
Newer systems might not have udevsettle. It has been replaced by
"udevadm settle".
Thanks to Lorenzo Cogotti aka Micia for this knowledge, and for a
proposed solution.
---
src/GParted_Core.cc | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 0da3b33..f9d26f6 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -2666,10 +2666,12 @@ bool GParted_Core::commit_to_os( std::time_t timeout )
else
succes = ped_disk_commit_to_os( lp_disk ) ;
- if ( Glib::find_program_in_path( "udevsettle" ) .empty() )
- sleep( timeout ) ;
- else
+ if ( ! Glib::find_program_in_path( "udevsettle" ) .empty() )
Utils::execute_command( "udevsettle --timeout=" + Utils::num_to_str( timeout ) ) ;
+ else if ( ! Glib::find_program_in_path( "udevadm" ) .empty() )
+ Utils::execute_command( "udevadm settle --timeout=" + Utils::num_to_str( timeout ) ) ;
+ else
+ sleep( timeout ) ;
return succes ;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]