forked from sdr/gr-osmosdr
rfspace: properly cover the absense of a serial number
This commit is contained in:
parent
d960d1119c
commit
24f6f88a37
|
@ -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 )
|
||||||
|
|
Loading…
Reference in New Issue