iocsh allow setting of error code

This commit is contained in:
Michael Davidsaver
2019-05-02 20:18:12 -07:00
parent 89c269e2d5
commit eba8a13a2c
2 changed files with 13 additions and 0 deletions

View File

@@ -511,6 +511,17 @@ typedef struct {
bool errored;
} Scope;
int iocshSetError(int err)
{
Scope *scope;
if (err && iocshScopeId) {
scope = (Scope *) epicsThreadPrivateGet(iocshScopeId);
if(scope) scope->errored = 1;
}
return err;
}
/*
* The body of the command interpreter
*/