rfspace: properly cover the absense of a serial number

This commit is contained in:
Dimitri Stolnikov 2014-01-26 19:53:44 +01:00
parent d960d1119c
commit 24f6f88a37
1 changed files with 3 additions and 1 deletions

View File

@ -1124,7 +1124,7 @@ static std::string read_file(const char *filename)
return contents; return contents;
} }
throw(errno); return "";
} }
static std::vector < unit_t > discover_sdr_iq() static std::vector < unit_t > discover_sdr_iq()
@ -1207,6 +1207,8 @@ static std::vector < unit_t > discover_sdr_iq()
continue; continue;
std::string serial = read_file( (path + "/serial").c_str() ); std::string serial = read_file( (path + "/serial").c_str() );
if ( serial.empty() )
serial = "<none>";
pos = serial.find('\n'); pos = serial.find('\n');
if ( pos != std::string::npos ) if ( pos != std::string::npos )