aqhome: fixed a bug.

This commit is contained in:
Martin Preuss
2023-02-05 23:43:53 +01:00
parent 9f45b70e36
commit 012e33aea1

View File

@@ -156,7 +156,7 @@ int AQH_Serial_IsOpen(AQH_SERIAL *sr)
{
if (sr->fd<0) {
DBG_ERROR(NULL, "Device not open");
return GWEN_ERROR_NOT_OPEN;
return 0;
}
else {
struct termios options;
@@ -165,7 +165,7 @@ int AQH_Serial_IsOpen(AQH_SERIAL *sr)
rv=tcgetattr(sr->fd, &options);
if (rv<0) {
DBG_ERROR(NULL, "Error on tcgetattr(%s): %s (%d)", sr->deviceName, strerror(errno), errno);
return GWEN_ERROR_IO;
return 0;
}
return 1;
}