From 15cf7fe3f5126f26c8ba584a5294c4c2cbb47db3 Mon Sep 17 00:00:00 2001 From: Steffen Pohle Date: Sun, 29 Jan 2023 20:15:50 +0100 Subject: [PATCH] adding errormessage --- posctl.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/posctl.cc b/posctl.cc index 9911605..6f9bfcc 100644 --- a/posctl.cc +++ b/posctl.cc @@ -650,9 +650,13 @@ void PosCtl::OutputWriteValue (int axis, double value) { printf ("%s:%d %s send: '%s'\n", __FILE__, __LINE__, __FUNCTION__, outbuf); len = write (device_fd, outbuf, strlen(outbuf)); - if ((size_t) len != strlen(outbuf) || len < 0) - printf ("%s:%d could not open device:%s Error:%s\n", __FILE__, __LINE__, + if ((size_t) len != strlen(outbuf) || len < 0) { + printf ("%s:%d could not write data to device:%s Error:%s\n", __FILE__, __LINE__, + device.c_str(), strerror(errno)); + errormessage_display ((char *)"window-posctl", (char *)"OutputWriteValue", + "%s:%d could not write data to device:%s Error:%s\n", __FILE__, __LINE__, device.c_str(), strerror(errno)); + } }; void PosCtl::OutputWriteStop (int axis) {