Fstat does not work for me, but checking the device file does.

pull/70/head
weetmuts 2020-01-19 23:24:38 +01:00
rodzic 611fd75e4c
commit 62ebea3244
1 zmienionych plików z 1 dodań i 3 usunięć

Wyświetl plik

@ -306,9 +306,7 @@ bool SerialDeviceTTY::working()
{
if (fd_ == -1) return false;
// test if the device is working by checking if the virtual file has been deleted using stat
struct stat sb;
int working = (fstat(fd_, &sb) == 0);
bool working = checkCharacterDeviceExists(device_.c_str(), false);
if (!working) {
debug("(serial) device %s is gone\n", device_.c_str());