iocsh allow setting of error code
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -89,6 +89,8 @@ epicsShareFunc int epicsShareAPI iocshCmd(const char *cmd);
|
||||
epicsShareFunc int epicsShareAPI iocshLoad(const char *pathname, const char* macros);
|
||||
epicsShareFunc int epicsShareAPI iocshRun(const char *cmd, const char* macros);
|
||||
|
||||
epicsShareFunc int iocshSetError(int err);
|
||||
|
||||
/* Makes macros that shadow environment variables work correctly with epicsEnvSet */
|
||||
epicsShareFunc void epicsShareAPI iocshEnvClear(const char *name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user