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:
parent
c2cd718bb5
commit
a05751ea95
|
@ -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 ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue