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.
This commit is contained in:
Curtis Gedak 2009-04-24 11:12:29 -06:00
parent c2cd718bb5
commit a05751ea95
1 changed files with 5 additions and 3 deletions

View File

@ -2666,10 +2666,12 @@ bool GParted_Core::commit_to_os( std::time_t timeout )
else else
succes = ped_disk_commit_to_os( lp_disk ) ; succes = ped_disk_commit_to_os( lp_disk ) ;
if ( Glib::find_program_in_path( "udevsettle" ) .empty() ) if ( ! Glib::find_program_in_path( "udevsettle" ) .empty() )
sleep( timeout ) ;
else
Utils::execute_command( "udevsettle --timeout=" + Utils::num_to_str( timeout ) ) ; 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 ; return succes ;
} }