Fail more gracefully if file of restrictions is not accessible.

This commit is contained in:
DennisOSRM 2012-03-01 15:58:10 +01:00
parent 63f4aaf7dd
commit 3cc3d4fd3b

View File

@ -85,6 +85,9 @@ int main (int argc, char *argv[]) {
INFO("Using restrictions from file: " << argv[2]);
std::ifstream restrictionsInstream(argv[2], ios::binary);
if(!restrictionsInstream.good()) {
ERR("Could not access <osrm-restrictions> files");
}
_Restriction restriction;
unsigned usableRestrictionsCounter(0);
restrictionsInstream.read((char*)&usableRestrictionsCounter, sizeof(unsigned));