From 5ac24490d354c586e38a13cd7f9745af5fb47545 Mon Sep 17 00:00:00 2001 From: Steffen Pohle Date: Wed, 21 Feb 2024 20:06:10 +0100 Subject: [PATCH] posctl: command without feedback will cause false error message --- posctl.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/posctl.cc b/posctl.cc index db0fd90..3871828 100644 --- a/posctl.cc +++ b/posctl.cc @@ -968,11 +968,14 @@ int PosCtl::ReadTTY (char * inbuf, int length) { } if (len < 0) { - printf ("%s:%d could not read data from device:%s Error:%s\n", __FILE__, __LINE__, - device.c_str(), strerror(errno)); - errormessage_display ((char *)"window-posctl", (char *)"ReadTTY", - (char *) "%s:%d could not read data from device:%s Error:%s\n", __FILE__, __LINE__, - device.c_str(), strerror(errno)); + if (errno != EAGAIN) { + + printf ("%s:%d could not read data from device:%s Error:(%d) %s\n", __FILE__, __LINE__, + device.c_str(), errno, strerror(errno)); + errormessage_display ((char *)"window-posctl", (char *)"ReadTTY", + (char *) "%s:%d could not read data from device:%s Error:%s\n", __FILE__, __LINE__, + device.c_str(), strerror(errno)); + } inbuf[0] = 0; } else {