Skip to content
Snippets Groups Projects
Commit a8a7a119 authored by benjamin.franksen's avatar benjamin.franksen
Browse files

seq: factored out pv_call_failure

parent 56eb44a1
No related branches found
No related tags found
No related merge requests found
...@@ -47,6 +47,13 @@ static void completion_timeout(pvEventType evtype, PVMETA *meta) ...@@ -47,6 +47,13 @@ static void completion_timeout(pvEventType evtype, PVMETA *meta)
meta->message = pvEventGet ? "get completion failure" : "put completion failure";; meta->message = pvEventGet ? "get completion failure" : "put completion failure";;
} }
static void pv_call_failure(DBCHAN *dbch, PVMETA *meta, pvStat status)
{
meta->status = status;
meta->severity = pvSevrERROR;
meta->message = pvVarGetMess(dbch->pvid);
}
static pvStat check_connected(DBCHAN *dbch, PVMETA *meta) static pvStat check_connected(DBCHAN *dbch, PVMETA *meta)
{ {
if (!dbch->connected) if (!dbch->connected)
...@@ -222,9 +229,7 @@ epicsShareFunc pvStat seq_pvGet(SS_ID ss, VAR_ID varId, enum compType compType, ...@@ -222,9 +229,7 @@ epicsShareFunc pvStat seq_pvGet(SS_ID ss, VAR_ID varId, enum compType compType,
req); /* user arg */ req); /* user arg */
if (status != pvStatOK) if (status != pvStatOK)
{ {
meta->status = pvStatERROR; pv_call_failure(dbch, meta, status);
meta->severity = pvSevrERROR;
meta->message = pvVarGetMess(dbch->pvid);
errlogSevPrintf(errlogFatal, errlogSevPrintf(errlogFatal,
"pvGet(var %s, pv %s): pvVarGetCallback() failure: %s\n", "pvGet(var %s, pv %s): pvVarGetCallback() failure: %s\n",
ch->varName, dbch->dbName, pvVarGetMess(dbch->pvid)); ch->varName, dbch->dbName, pvVarGetMess(dbch->pvid));
...@@ -460,6 +465,7 @@ epicsShareFunc pvStat seq_pvPut(SS_ID ss, VAR_ID varId, enum compType compType, ...@@ -460,6 +465,7 @@ epicsShareFunc pvStat seq_pvPut(SS_ID ss, VAR_ID varId, enum compType compType,
(pvValue *)var); /* data value */ (pvValue *)var); /* data value */
if (status != pvStatOK) if (status != pvStatOK)
{ {
pv_call_failure(dbch, meta, status);
errlogSevPrintf(errlogFatal, "pvPut(var %s, pv %s): pvVarPutNoBlock() failure: %s\n", errlogSevPrintf(errlogFatal, "pvPut(var %s, pv %s): pvVarPutNoBlock() failure: %s\n",
ch->varName, dbch->dbName, pvVarGetMess(dbch->pvid)); ch->varName, dbch->dbName, pvVarGetMess(dbch->pvid));
return status; return status;
...@@ -483,6 +489,7 @@ epicsShareFunc pvStat seq_pvPut(SS_ID ss, VAR_ID varId, enum compType compType, ...@@ -483,6 +489,7 @@ epicsShareFunc pvStat seq_pvPut(SS_ID ss, VAR_ID varId, enum compType compType,
req); /* user arg */ req); /* user arg */
if (status != pvStatOK) if (status != pvStatOK)
{ {
pv_call_failure(dbch, meta, status);
errlogSevPrintf(errlogFatal, "pvPut(var %s, pv %s): pvVarPutCallback() failure: %s\n", errlogSevPrintf(errlogFatal, "pvPut(var %s, pv %s): pvVarPutCallback() failure: %s\n",
ch->varName, dbch->dbName, pvVarGetMess(dbch->pvid)); ch->varName, dbch->dbName, pvVarGetMess(dbch->pvid));
ss->putReq[varId] = NULL; /* cancel the request */ ss->putReq[varId] = NULL; /* cancel the request */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment