diff --git a/modules/database/src/ioc/dbStatic/dbLexRoutines.c b/modules/database/src/ioc/dbStatic/dbLexRoutines.c index 702b2291ed..7d0bb38926 100644 --- a/modules/database/src/ioc/dbStatic/dbLexRoutines.c +++ b/modules/database/src/ioc/dbStatic/dbLexRoutines.c @@ -1263,8 +1263,9 @@ static void dbRecordAlias(char *name) pdbentry = ptempListNode->item; status = dbCreateAlias(pdbentry, name); if (status) { - fprintf(stderr, "Can't create alias \"%s\" for \"%s\"\n", - name, dbGetRecordName(pdbentry)); + fprintf(stderr, "Can't create alias \"%s\" for \"%s\"%s\n", + name, dbGetRecordName(pdbentry), + status == S_dbLib_recExists ? ", name already used" : ""); yyerror(NULL); return; } @@ -1274,6 +1275,7 @@ static void dbAlias(char *name, char *alias) { DBENTRY dbEntry; DBENTRY *pdbEntry = &dbEntry; + long status; if(dbRecordNameValidate(alias) || dbRecordNameValidate(name)) return; @@ -1284,9 +1286,10 @@ static void dbAlias(char *name, char *alias) alias, name); yyerror(NULL); } - else if (dbCreateAlias(pdbEntry, alias)) { - fprintf(stderr, "Can't create alias \"%s\" referring to \"%s\"\n", - alias, name); + else if ((status = dbCreateAlias(pdbEntry, alias))) { + fprintf(stderr, "Can't create alias \"%s\" referring to \"%s\%s"\n", + alias, name + status == S_dbLib_recExists ? ", name already used" : ""); yyerror(NULL); } dbFinishEntry(pdbEntry);