From a547499904d64c518a1f6b36098a35b93406ad7b Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Mon, 29 Nov 2004 15:27:33 +0000 Subject: [PATCH] It seemed some kernels remove and re-add blockdevicepaths after the * src/GParted_Core.cc: It seemed some kernels remove and re-add blockdevicepaths after the commit_to_os. This caused trouble at some points where the path was required. I decided to sleep 1 sec after each scan. So rescanning devices will take 1 extra second per device :| * src/Win_GParted.cc: fixed typo in string. --- ChangeLog | 6 ++++++ src/GParted_Core.cc | 7 ++++++- src/Win_GParted.cc | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6409e9a..29d23cb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-11-29 Bart Hakvoort + + * src/GParted_Core.cc: It seemed some kernels remove and re-add blockdevicepaths after the commit_to_os. This caused trouble at some points + where the path was required. I decided to sleep 1 sec after each scan. So rescanning devices will take 1 extra second per device :| + * src/Win_GParted.cc: fixed typo in string. + 2004-11-29 Bart Hakvoort * Every devicescan now tests on beforehand if the kernel is able to reread the partitiontable. If the kernel is unable to do diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 80af98cc..9de2dc7f 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -94,7 +94,12 @@ void GParted_Core::get_devices( std::vector & devices, bool deep_scan ) { temp_device .disktype = disk ->type ->name ; temp_device .max_prims = ped_disk_get_max_primary_partition_count( disk ) ; - temp_device .readonly = ! ped_disk_commit_to_os( disk ) ; + + if ( deep_scan ) + { + temp_device .readonly = ! ped_disk_commit_to_os( disk ) ; + sleep( 1 ) ;//this sucks, but it seems that after the commit test, the paths are removed and added again (which takes time..) + } set_device_partitions( temp_device, deep_scan ) ; } diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index 1a3a3915..b3915553 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -738,7 +738,7 @@ void Win_GParted::menu_gparted_refresh_devices() str_temp += readonly_paths ; str_temp += "\n\n" ; - str_temp += _("Because of this you will only have limited access to these decices.") ; + str_temp += _("Because of this you will only have limited access to these devices.") ; str_temp += "\n" ; str_temp += _("Unmount all mounted partitions on a device to get full access.") ;