kopia lustrzana https://github.com/weetmuts/wmbusmeters
Fstat does not work for me, but checking the device file does.
rodzic
611fd75e4c
commit
62ebea3244
|
@ -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());
|
||||
|
|
Ładowanie…
Reference in New Issue