Skip to content

Commit

Permalink
allow to redefine alias if record is identical
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-zimoch committed Aug 13, 2024
1 parent 24e4c59 commit cc8d7d8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/database/src/ioc/dbStatic/dbStaticLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1668,9 +1668,12 @@ long dbCreateAlias(DBENTRY *pdbentry, const char *alias)
dbInitEntry(pdbentry->pdbbase, &tempEntry);
status = dbFindRecord(&tempEntry, alias);
dbFinishEntry(&tempEntry);
if (!status)
if (!status) {
/* redefining the same alias for the same record is ok */
if (tempEntry.precnode == precnode)
return 0;
return S_dbLib_recExists;

}
pnewnode = dbCalloc(1, sizeof(dbRecordNode));
pnewnode->recordname = epicsStrDup(alias);
pnewnode->precord = precnode->precord;
Expand Down

0 comments on commit cc8d7d8

Please sign in to comment.