check if file is open before using it. removed commented include
* src/GParted_Core.cc: check if file is open before using it. * src/Utils.cc: removed commented include
This commit is contained in:
parent
808b777019
commit
523bc6a6b4
|
@ -1,3 +1,8 @@
|
|||
2005-12-13 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||
|
||||
* src/GParted_Core.cc: check if file is open before using it.
|
||||
* src/Utils.cc: removed commented include
|
||||
|
||||
2005-12-13 Bart Hakvoort <hakvoort@cvs.gnome.org>
|
||||
|
||||
* replaced the inline Utils functions with static functions.
|
||||
|
|
|
@ -279,15 +279,19 @@ void GParted_Core::set_mountpoints( std::vector<Partition> & partitions, bool fi
|
|||
{
|
||||
if ( first_time )
|
||||
{
|
||||
char node[255], mountpoint[255] ;
|
||||
std::string line ;
|
||||
std::ifstream input( "/proc/mounts" ) ;
|
||||
|
||||
while ( getline( input, line ) )
|
||||
if ( input )
|
||||
{
|
||||
char node[255], mountpoint[255] ;
|
||||
std::string line ;
|
||||
|
||||
while ( getline( input, line ) )
|
||||
if ( line .length() > 0 && line[ 0 ] == '/' && sscanf( line .c_str(),"%s %s", node, mountpoint ) == 2 )
|
||||
mount_info[ node ] = mountpoint ;
|
||||
|
||||
input .close() ;
|
||||
input .close() ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "../include/Utils.h"
|
||||
|
||||
#include <sstream>
|
||||
//#include <vector>
|
||||
|
||||
namespace GParted
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue