Add ERROR to error messages
This commit is contained in:
@@ -798,18 +798,13 @@ int dbLoadRecords(const char* file, const char* subs)
|
||||
return -1;
|
||||
}
|
||||
status = dbReadDatabase(&pdbbase, file, 0, subs);
|
||||
switch(status)
|
||||
{
|
||||
case 0:
|
||||
if(status==0) {
|
||||
if(dbLoadRecordsHook)
|
||||
dbLoadRecordsHook(file, subs);
|
||||
break;
|
||||
case -2:
|
||||
errlogPrintf("dbLoadRecords: failed to load '%s'\n"
|
||||
" Records cannot be loaded after iocInit!\n", file);
|
||||
break;
|
||||
default:
|
||||
errlogPrintf("dbLoadRecords: failed to load '%s'\n", file);
|
||||
} else {
|
||||
fprintf(stderr, ERL_ERROR " failed to load '%s'\n", file);
|
||||
if(status==-2)
|
||||
fprintf(stderr, " Records cannot be loaded after iocInit!\n");
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ static void inputOpenFile(inputData *pinputData, const char * const filename)
|
||||
}
|
||||
|
||||
if (!fp) {
|
||||
fprintf(stderr, "msi: Can't open file '%s'\n", filename);
|
||||
fprintf(stderr, ERL_ERROR " msi: Can't open file '%s'\n", filename);
|
||||
inputErrPrint(pinputData);
|
||||
abortExit(1);
|
||||
}
|
||||
@@ -672,7 +672,7 @@ static void substituteOpen(subInfo **ppvt, const std::string& substitutionName)
|
||||
|
||||
fp = fopen(substitutionName.c_str(), "r");
|
||||
if (!fp) {
|
||||
fprintf(stderr, "msi: Can't open file '%s'\n", substitutionName.c_str());
|
||||
fprintf(stderr, ERL_ERROR " msi: Can't open file '%s'\n", substitutionName.c_str());
|
||||
abortExit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -176,12 +176,12 @@ long epicsStdCall asInitFile(const char *filename,const char *substitutions)
|
||||
|
||||
fp = fopen(filename,"r");
|
||||
if(!fp) {
|
||||
errlogPrintf("asInitFile: Can't open file '%s'\n", filename);
|
||||
fprintf(stderr, ERL_ERROR " asInitFile: Can't open file '%s'\n", filename);
|
||||
return(S_asLib_badConfig);
|
||||
}
|
||||
status = asInitFP(fp,substitutions);
|
||||
if(fclose(fp)==EOF) {
|
||||
errMessage(0,"asInitFile: fclose failed!");
|
||||
fprintf(stderr, ERL_ERROR " asInitFile: fclose failed!");
|
||||
if(!status) status = S_asLib_badConfig;
|
||||
}
|
||||
return(status);
|
||||
|
||||
@@ -204,7 +204,7 @@ showError (const char *filename, int lineno, const char *msg, ...)
|
||||
|
||||
va_start (ap, msg);
|
||||
if (filename)
|
||||
fprintf(epicsGetStderr(), "%s line %d: ", filename, lineno);
|
||||
fprintf(epicsGetStderr(), ERL_ERROR " %s line %d: ", filename, lineno);
|
||||
vfprintf (epicsGetStderr(), msg, ap);
|
||||
fputc ('\n', epicsGetStderr());
|
||||
va_end (ap);
|
||||
@@ -1438,12 +1438,12 @@ static void varCallFunc(const iocshArgBuf *args)
|
||||
found = 1;
|
||||
}
|
||||
if (!found && name != NULL)
|
||||
fprintf(epicsGetStderr(), "No var matching %s found.\n", name);
|
||||
fprintf(epicsGetStderr(), ANSI_RED("No var matching") " %s found.\n", name);
|
||||
}
|
||||
else {
|
||||
v = (iocshVariable *)registryFind(iocshVarID, args[0].sval);
|
||||
if (v == NULL) {
|
||||
fprintf(epicsGetStderr(), "Var %s not found.\n", name);
|
||||
fprintf(epicsGetStderr(), "Var %s " ANSI_RED("not found.") "\n", name);
|
||||
}
|
||||
else {
|
||||
varHandler(v->pVarDef, value);
|
||||
|
||||
Reference in New Issue
Block a user