From 24e4c59f60e876c118c4b04157be8c7fb56c59e5 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Wed, 10 Apr 2024 14:22:47 +0200 Subject: [PATCH] show reason for dbCreateAlias failure --- modules/database/src/ioc/dbStatic/dbLexRoutines.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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);