parent
a4c9412f74
commit
9db4c229e5
@ -1 +1 @@
|
|||||||
gparted-0.3.3.tar.bz2
|
gparted-0.3.5.tar.bz2
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
--- src/GParted_Core.cc 2006/12/08 13:14:05 759
|
|
||||||
+++ src/GParted_Core.cc 2007/01/07 20:29:03 764
|
|
||||||
@@ -155,7 +155,20 @@
|
|
||||||
lp_device = ped_device_get_next( NULL );
|
|
||||||
while ( lp_device )
|
|
||||||
{
|
|
||||||
- device_paths .push_back( lp_device ->path ) ;
|
|
||||||
+ //only add this device if we can read the first sector (which means it's a real device)
|
|
||||||
+ char * buf = static_cast<char *>( malloc( lp_device ->sector_size ) ) ;
|
|
||||||
+ if ( buf )
|
|
||||||
+ {
|
|
||||||
+ if ( ped_device_open( lp_device ) )
|
|
||||||
+ {
|
|
||||||
+ if ( ped_device_read( lp_device, buf, 0, 1 ) )
|
|
||||||
+ device_paths .push_back( lp_device ->path ) ;
|
|
||||||
+
|
|
||||||
+ ped_device_close( lp_device ) ;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ free( buf ) ;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
lp_device = ped_device_get_next( lp_device ) ;
|
|
||||||
}
|
|
||||||
@@ -163,10 +176,10 @@
|
|
||||||
|
|
||||||
std::sort( device_paths .begin(), device_paths .end() ) ;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+
|
|
||||||
for ( unsigned int t = 0 ; t < device_paths .size() ; t++ )
|
|
||||||
{
|
|
||||||
- if ( device_paths[ t ] .length() > 6 && device_paths[ t ] .is_ascii() && open_device_and_disk( device_paths[ t ], false ) )
|
|
||||||
+ if ( open_device_and_disk( device_paths[ t ], false ) )
|
|
||||||
{
|
|
||||||
temp_device .Reset() ;
|
|
@ -1,28 +1,11 @@
|
|||||||
--- src/GParted_Core.cc 2006-12-05 14:39:31.000000000 -0500
|
--- src/GParted_Core.cc 2008-02-04 09:35:47.000000000 -0500
|
||||||
+++ src/GParted_Core.cc.new 2007-11-22 00:01:43.000000000 -0500
|
+++ src/GParted_Core.cc.new2 2008-02-07 15:57:14.000000000 -0500
|
||||||
@@ -487,19 +487,23 @@
|
@@ -527,7 +527,7 @@
|
||||||
while ( getline( proc_partitions, line ) )
|
std::ifstream proc_partitions( "/proc/partitions" ) ;
|
||||||
if ( sscanf( line .c_str(), "%*d %*d %*d %255s", c_str ) == 1 )
|
if ( proc_partitions )
|
||||||
{
|
|
||||||
+ char *real_path = NULL;
|
|
||||||
+
|
|
||||||
line = "/dev/" ;
|
|
||||||
line += c_str ;
|
|
||||||
|
|
||||||
//FIXME: it seems realpath is very unsafe to use (manpage)...
|
|
||||||
+ real_path = realpath( line .c_str(), NULL ) ;
|
|
||||||
if ( file_test( line, Glib::FILE_TEST_EXISTS ) &&
|
|
||||||
- realpath( line .c_str(), c_str ) &&
|
|
||||||
+ real_path &&
|
|
||||||
line != c_str )
|
|
||||||
{
|
{
|
||||||
//because we can make no assumption about which path libparted will detect
|
- char c_str[255] ;
|
||||||
//we add all combinations.
|
+ char c_str[PATH_MAX+1] ;
|
||||||
alternate_paths[ c_str ] = line ;
|
|
||||||
- alternate_paths[ line ] = c_str ;
|
|
||||||
}
|
|
||||||
+ if ( real_path )
|
|
||||||
+ free( real_path ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
proc_partitions .close() ;
|
while ( getline( proc_partitions, line ) )
|
||||||
|
if ( sscanf( line .c_str(), "%*d %*d %*d %255s", c_str ) == 1 )
|
||||||
|
Loading…
Reference in new issue