always enable error messages when loading protocol files

This commit is contained in:
2018-07-06 17:02:34 +02:00
parent 343eef324b
commit e09506c2bb
2 changed files with 7 additions and 1 deletions

View File

@ -196,8 +196,12 @@ extern "C" long streamReload(char* recordname)
dbCommon* record; dbCommon* record;
long status; long status;
int oldStreamError = streamError;
streamError = 1;
if(!pdbbase) { if(!pdbbase) {
error("No database has been loaded\n"); error("No database has been loaded\n");
streamError = oldStreamError;
return ERROR; return ERROR;
} }
debug("streamReload(%s)\n", recordname); debug("streamReload(%s)\n", recordname);
@ -234,6 +238,7 @@ extern "C" long streamReload(char* recordname)
} }
dbFinishEntry(&dbentry); dbFinishEntry(&dbentry);
StreamProtocolParser::free(); StreamProtocolParser::free();
streamError = oldStreamError;
return OK; return OK;
} }
@ -408,6 +413,7 @@ long streamInit(int after)
{ {
if (after) if (after)
{ {
streamError = 0; // Switch off errors after init in order not to spam messages when a device is down.
StreamProtocolParser::free(); StreamProtocolParser::free();
} }
return OK; return OK;

View File

@ -23,7 +23,7 @@
#include <stdio.h> #include <stdio.h>
int streamDebug = 0; int streamDebug = 0;
int streamError = 0; int streamError = 1;
extern "C" { extern "C" {
#ifdef _WIN32 #ifdef _WIN32
__declspec(dllexport) __declspec(dllexport)