[c-host] linux: correct device name comparison

This commit is contained in:
Geoffrey McRae 2019-03-01 21:17:16 +11:00
parent 22e5b323c8
commit 4a72dab02a

View File

@ -104,9 +104,15 @@ int main(int argc, char * argv[])
name[len] = '\0';
close(fd);
while(len > 0 && name[len-1] == '\n')
{
--len;
name[len] = '\0';
}
if (strcmp(name, "KVMFR") != 0)
{
DEBUG_ERROR("Device is not a KVMFR device %s reports as %s", file, name);
DEBUG_ERROR("Device is not a KVMFR device \"%s\" reports as: %s", file, name);
return -1;
}
}
@ -149,6 +155,8 @@ int main(int argc, char * argv[])
DEBUG_ERROR("Failed to open: %s", file);
return -1;
}
DEBUG_INFO("KVMFR Device : %s", file);
}
bool termSig = false;