iocshRegisterVariable() avoid spurious redefinition warning

Compare the contents, not the container.
This commit is contained in:
Michael Davidsaver
2020-06-15 11:04:59 -07:00
parent 2c389a90d1
commit 9e3d5d52ab

View File

@@ -181,7 +181,7 @@ void epicsStdCall 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) {
if (p->pVarDef != piocshVarDef) {
if ((p->pVarDef->type != piocshVarDef->type) && (p->pVarDef->pval != piocshVarDef->pval)) {
errlogPrintf("Warning: iocshRegisterVariable redefining %s.\n",
piocshVarDef->name);
p->pVarDef = piocshVarDef;