libCom: iocshRegisterVariable() only warn on actual redefinition

Avoid noise if simply called twice.
This commit is contained in:
Michael Davidsaver
2018-11-04 11:39:14 -08:00
parent 00d937cc02
commit ebe7cf046e

View File

@@ -178,9 +178,11 @@ void epicsShareAPI iocshRegisterVariable (const iocshVarDef *piocshVarDef)
for (l = NULL, p = iocshVariableHead ; p != NULL ; l = p, p = p->next) {
i = strcmp (piocshVarDef->name, p->pVarDef->name);
if (i == 0) {
errlogPrintf("Warning: iocshRegisterVariable redefining %s.\n",
piocshVarDef->name);
p->pVarDef = piocshVarDef;
if (p->pVarDef != piocshVarDef) {
errlogPrintf("Warning: iocshRegisterVariable redefining %s.\n",
piocshVarDef->name);
p->pVarDef = piocshVarDef;
}
found = 1;
break;
}