diff --git a/src/db/dbPutNotifyBlocker.cpp b/src/db/dbPutNotifyBlocker.cpp index ff037bb67..4bcaac5cf 100644 --- a/src/db/dbPutNotifyBlocker.cpp +++ b/src/db/dbPutNotifyBlocker.cpp @@ -34,9 +34,6 @@ #include "dbChannelIOIL.h" #include "dbNotifyBlockerIL.h" -#define S_db_Blocked (M_dbAccess|39) -#define S_db_Pending (M_dbAccess|37) - #if defined ( _MSC_VER ) # pragma warning ( push ) # pragma warning ( disable: 4660 ) @@ -80,8 +77,8 @@ extern "C" void putNotifyCompletion ( putNotify *ppn ) { dbPutNotifyBlocker *pBlocker = static_cast < dbPutNotifyBlocker * > ( ppn->usrPvt ); if ( pBlocker->pNotify ) { - if ( pBlocker->pn.status ) { - if ( pBlocker->pn.status == S_db_Blocked ) { + if ( pBlocker->pn.status != putNotifyOK) { + if ( pBlocker->pn.status == putNotifyBlocked ) { pBlocker->pNotify->exception ( ECA_PUTCBINPROG, "put notify blocked", static_cast (pBlocker->pn.dbrType), @@ -156,18 +153,7 @@ void dbPutNotifyBlocker::initiatePutNotify ( epicsAutoMutex & locker, cacWriteNo this->pn.userCallback = putNotifyCompletion; this->pn.usrPvt = this; - status = ::dbPutNotify ( &this->pn ); - if ( status && status != S_db_Pending ) { - memset ( &this->pn, '\0', sizeof ( this->pn ) ); - this->pNotify = 0; - { - epicsAutoMutexRelease autoRelease ( locker ); - notify.exception ( - ECA_PUTFAIL, "dbPutNotify() returned failure", - static_cast (this->pn.dbrType), - static_cast (this->pn.nRequest) ); - } - } + ::dbPutNotify ( &this->pn ); } void dbPutNotifyBlocker::show ( unsigned level ) const diff --git a/src/db/db_test.c b/src/db/db_test.c index 4668a16e8..fdc443a9d 100644 --- a/src/db/db_test.c +++ b/src/db/db_test.c @@ -657,7 +657,7 @@ static void print_returned(type,pbuffer,count) static void tpnCallback(putNotify *ppn) { struct dbAddr *pdbaddr = (struct dbAddr *)ppn->paddr; - long status = ppn->status; + putNotifyStatus status = ppn->status; char *pname; /*This is really cheating. It only works because first field is name*/ @@ -665,7 +665,7 @@ static void tpnCallback(putNotify *ppn) if(status==0) printf("tpnCallback: success record=%s\n",pname); else - errPrintf(status,__FILE__,__LINE__,"%s tpnCallback\n",pname); + errlogPrintf("%s tpnCallback status = %d\n",status); free((void *)pdbaddr); free(ppn); } @@ -707,9 +707,6 @@ int epicsShareAPI tpn(char *pname,char *pvalue) return(-1); } ppn->userCallback = tpnCallback; - status = dbPutNotify(ppn); - if(status) { - errMessage(status, "tpn"); - } + dbPutNotify(ppn); return(0); } diff --git a/src/rsrv/camessage.c b/src/rsrv/camessage.c index 8be9dfa05..9a57091a1 100644 --- a/src/rsrv/camessage.c +++ b/src/rsrv/camessage.c @@ -1442,8 +1442,8 @@ void write_notify_reply(void *pArg) * the channel id field is being abused to carry * status here */ - if(ppnb->dbPutNotify.status){ - if(ppnb->dbPutNotify.status == S_db_Blocked){ + if(ppnb->dbPutNotify.status != putNotifyOK){ + if(ppnb->dbPutNotify.status == putNotifyBlocked){ status = ECA_PUTCBINPROG; } else{ @@ -1600,16 +1600,7 @@ LOCAL int write_notify_action ( caHdrLargeArray *mp, void *pPayload, return RSRV_OK; } - status = dbPutNotify(&pciu->pPutNotify->dbPutNotify); - if(status && status != S_db_Pending){ - /* - * let the call back take care of failure - * even if it is immediate - */ - pciu->pPutNotify->dbPutNotify.status = status; - (*pciu->pPutNotify->dbPutNotify.userCallback) - (&pciu->pPutNotify->dbPutNotify); - } + dbPutNotify(&pciu->pPutNotify->dbPutNotify); return RSRV_OK; } diff --git a/src/rsrv/server.h b/src/rsrv/server.h index cee4a5a2c..c2da22717 100644 --- a/src/rsrv/server.h +++ b/src/rsrv/server.h @@ -226,14 +226,4 @@ int cas_copy_in_header ( void cas_set_header_cid ( struct client *pClient, ca_uint32_t ); void cas_commit_msg ( struct client *pClient, ca_uint32_t size ); -/* - * !!KLUDGE!! - * - * this was extracted from dbAccess.h because we are unable - * to include both dbAccess.h and db_access.h at the - * same time. - */ -#define S_db_Blocked (M_dbAccess|39) /*Request is Blocked*/ -#define S_db_Pending (M_dbAccess|37) /*Request is pending*/ - #endif /*INCLserverh*/