diff --git a/aqhome/ipc2/tty_object.c b/aqhome/ipc2/tty_object.c index 49ccacd..03056b0 100644 --- a/aqhome/ipc2/tty_object.c +++ b/aqhome/ipc2/tty_object.c @@ -50,11 +50,20 @@ static int _fdSetBlocking(int sk, int fl); AQH_OBJECT *AQH_TtyObject_new(AQH_EVENT_LOOP *eventLoop, int fd, int fdMode) { AQH_OBJECT *o; + int rv; o=AQH_FdObject_new(eventLoop, fd, fdMode); AQH_FdObject_SetStartMsgFn(o, _cbStartMsg); AQH_FdObject_SetEndMsgFn(o, _cbEndMsg); AQH_FdObject_SetFlushFn(o, _cbFlush); + + rv=tcflush(fd, TCIOFLUSH); + if (rv<0) { + if (errno!=EINTR && errno!=EWOULDBLOCK && errno!=EAGAIN) { + DBG_ERROR(AQH_LOGDOMAIN, "Error on tcflush: %s (%d)", strerror(errno), errno); + } + } + return o; }