aqhome: fixed a bug.

This commit is contained in:
Martin Preuss
2023-02-05 23:43:53 +01:00
parent 42ebb11a99
commit 7eaea20d12

View File

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