From f2ceb71c2b13bb03bc049de8e6d9f52e7dfddbfb Mon Sep 17 00:00:00 2001 From: Benjamin Franksen Date: Mon, 27 Nov 2017 19:00:00 +0100 Subject: [PATCH] Fixed indentation of a do-while loop in AsynDriverInterface.cc --- src/AsynDriverInterface.cc | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/AsynDriverInterface.cc b/src/AsynDriverInterface.cc index 0268ece..c73fd03 100644 --- a/src/AsynDriverInterface.cc +++ b/src/AsynDriverInterface.cc @@ -667,25 +667,28 @@ writeHandler() pasynUser->timeout = 0; if (!pasynGpib) - // discard any early input, but forward it to potential async records - // thus do not use pasynOctet->flush() - // unfortunately we cannot do this with GPIB because addressing a device as talker - // when it has nothing to say is an error. Also timeout=0 does not help here (would need - // a change in asynGPIB), thus use flush() for GPIB. - do { - char buffer [256]; - size_t received = 0; - int eomReason = 0; - debug("AsynDriverInterface::writeHandler(%s): reading old input\n", - clientName()); - status = pasynOctet->read(pvtOctet, pasynUser, - buffer, sizeof(buffer), &received, &eomReason); - if (status == asynError || received == 0) break; + { + // discard any early input, but forward it to potential async records + // thus do not use pasynOctet->flush() + // unfortunately we cannot do this with GPIB because addressing a device as talker + // when it has nothing to say is an error. Also timeout=0 does not help here + // (would need a change in asynGPIB), thus use flush() for GPIB. + do { + char buffer [256]; + size_t received = 0; + int eomReason = 0; + debug("AsynDriverInterface::writeHandler(%s): reading old input\n", + clientName()); + status = pasynOctet->read(pvtOctet, pasynUser, + buffer, sizeof(buffer), &received, &eomReason); + if (status == asynError || received == 0) break; #ifndef NO_TEMPORARY - if (received) debug("AsynDriverInterface::writeHandler(%s): flushing %ld bytes: \"%s\"\n", - clientName(), (long)received, StreamBuffer(buffer, received).expand()()); + if (received) debug("AsynDriverInterface::writeHandler(%s): " + "flushing %ld bytes: \"%s\"\n", + clientName(), (long)received, StreamBuffer(buffer, received).expand()()); #endif - } while (status == asynSuccess); + } while (status == asynSuccess); + } else { debug("AsynDriverInterface::writeHandler(%s): flushing old input\n",