aqhome: more work on new event/ipc interface.

This commit is contained in:
Martin Preuss
2025-02-26 20:59:20 +01:00
parent f63079af11
commit 8968f14122
34 changed files with 1233 additions and 126 deletions

View File

@@ -1,6 +1,6 @@
/****************************************************************************
* This file is part of the project Gwenhywfar.
* Gwenhywfar (c) by 2025 Martin Preuss, all rights reserved.
* This file is part of the project AqHome.
* AqHome (c) by 2025 Martin Preuss, all rights reserved.
*
* The license for this file can be found in the file COPYING which you
* should have received along with this file.
@@ -66,6 +66,9 @@ void GWENHYWFAR_CB _freeData(GWEN_UNUSED void *bp, void *p)
AQH_FDOBJECT *xo;
xo=(AQH_FDOBJECT*)p;
if (xo->fd>=0)
close(xo->fd);
xo->fd=-1;
GWEN_FREE_OBJECT(xo);
}
@@ -175,6 +178,7 @@ int AQH_FdObject_Read(AQH_OBJECT *o, uint8_t *ptrBuffer, uint32_t lenBuffer)
}
else {
DBG_ERROR(AQH_LOGDOMAIN, "Error on read: %s (%d)", strerror(errno), errno);
close(xo->fd);
xo->fd=-1;
return GWEN_ERROR_IO;
}
@@ -217,6 +221,7 @@ int AQH_FdObject_FlushInput(AQH_OBJECT *o)
else if (rv<0) {
if (errno!=EINTR && errno!=EWOULDBLOCK && errno!=EAGAIN) {
DBG_ERROR(AQH_LOGDOMAIN, "Error on read: %s (%d)", strerror(errno), errno);
close(xo->fd);
xo->fd=-1;
return GWEN_ERROR_IO;
}
@@ -253,6 +258,7 @@ int AQH_FdObject_Write(AQH_OBJECT *o, const uint8_t *ptrBuffer, uint32_t lenBuff
}
else {
DBG_ERROR(AQH_LOGDOMAIN, "Error on write: %s (%d)", strerror(errno), errno);
close(xo->fd);
xo->fd=-1;
return GWEN_ERROR_IO;
}