From 2a4fb01af5066d55d0d51f63aa150f725c4c5b66 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 31 Aug 2000 00:36:39 +0000 Subject: [PATCH] check for disconnected state first so they will get that error code --- src/ca/nciu.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ca/nciu.cpp b/src/ca/nciu.cpp index d0a0e7618..b8a21483b 100644 --- a/src/ca/nciu.cpp +++ b/src/ca/nciu.cpp @@ -110,6 +110,9 @@ int nciu::read ( unsigned type, unsigned long countIn, cacNotify ¬ify ) // // fail out if their arguments are invalid // + if ( ! this->f_connected ) { + return ECA_DISCONNCHID; + } if ( INVALID_DB_REQ (type) ) { return ECA_BADTYPE; } @@ -376,6 +379,11 @@ int nciu::write ( unsigned type, unsigned long countIn, const void *pValue ) { int status; + // check this first so thet get a decent diagnostic + if ( ! this->f_connected ) { + return ECA_DISCONNCHID; + } + if ( ! this->ar.write_access ) { return ECA_NOWTACCESS; } @@ -407,6 +415,11 @@ int nciu::write ( unsigned type, unsigned long countIn, const void *pValue, cacN ca_uint32_t newId; int status; + // check this first so thet get a decent diagnostic + if ( ! this->f_connected ) { + return ECA_DISCONNCHID; + } + if ( ! this->ar.write_access ) { return ECA_NOWTACCESS; }