"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/test_BlockSpecial.cc" between
gparted-1.0.0.tar.gz and gparted-1.1.0.tar.gz

About: GParted is a graphical partition editor for creating, reorganizing, and deleting disk partitions (using GNU libparted).

test_BlockSpecial.cc  (gparted-1.0.0):test_BlockSpecial.cc  (gparted-1.1.0)
skipping to change at line 141 skipping to change at line 141
// /dev/disk/by-id/. // /dev/disk/by-id/.
static std::string get_link_name() static std::string get_link_name()
{ {
DIR * dir = opendir( "/dev/disk/by-id" ); DIR * dir = opendir( "/dev/disk/by-id" );
if ( dir == NULL ) if ( dir == NULL )
{ {
ADD_FAILURE() << __func__ << "(): Failed to open directory '/dev/ disk/by-id'"; ADD_FAILURE() << __func__ << "(): Failed to open directory '/dev/ disk/by-id'";
return ""; return "";
} }
std::string name;
bool found = false; bool found = false;
struct dirent * dentry; struct dirent * dentry;
// Silence GCC [-Wparentheses] warning with double parentheses // Silence GCC [-Wparentheses] warning with double parentheses
while ( ( dentry = readdir( dir ) ) ) while ( ( dentry = readdir( dir ) ) )
{ {
if ( strcmp( dentry->d_name, "." ) != 0 && if ( strcmp( dentry->d_name, "." ) != 0 &&
strcmp( dentry->d_name, ".." ) != 0 ) strcmp( dentry->d_name, ".." ) != 0 )
{ {
name = dentry->d_name;
found = true; found = true;
break; break;
} }
} }
closedir( dir ); closedir( dir );
if ( found ) if ( found )
return std::string( "/dev/disk/by-id/" ) + dentry->d_name; return std::string("/dev/disk/by-id/") + name;
ADD_FAILURE() << __func__ << "(): No entries found in directory '/dev/dis k/by-id'"; ADD_FAILURE() << __func__ << "(): No entries found in directory '/dev/dis k/by-id'";
return ""; return "";
} }
// Follow symbolic link return real path. // Follow symbolic link return real path.
static std::string follow_link_name( std::string link ) static std::string follow_link_name( std::string link )
{ {
char * rpath = realpath( link.c_str(), NULL ); char * rpath = realpath( link.c_str(), NULL );
if ( rpath == NULL ) if ( rpath == NULL )
 End of changes. 3 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)