don't send errlog on all logClients

This commit is contained in:
2019-08-27 16:51:00 +02:00
parent 871af36ac5
commit 1b99366887
2 changed files with 14 additions and 4 deletions

View File

@@ -18,8 +18,10 @@
#define epicsExportSharedSymbols
#include "envDefs.h"
#include "errlog.h"
#include "logClient.h"
#include "iocLog.h"
#include "epicsExit.h"
int iocLogDisable = 0;
@@ -74,6 +76,14 @@ void epicsShareAPI epicsShareAPI iocLogFlush (void)
}
}
/*
* logClientDestroy()
*/
static void iocLogClientDestroy (logClientId id)
{
errlogRemoveListeners (logClientSendMessage, id);
}
/*
* iocLogClientInit()
*/
@@ -89,6 +99,10 @@ static logClientId iocLogClientInit (void)
return NULL;
}
id = logClientCreate (addr, port);
if (id != NULL) {
errlogAddListener (logClientSendMessage, id);
epicsAtExit (iocLogClientDestroy, id);
}
return id;
}

View File

@@ -154,8 +154,6 @@ static void logClientDestroy (logClientId id)
return;
}
errlogRemoveListeners ( logClientSendMessage, (void *) pClient );
logClientClose ( pClient );
epicsMutexDestroy ( pClient->mutex );
@@ -549,8 +547,6 @@ logClientId epicsShareAPI logClientCreate (
pClient->name, LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT );
}
errlogAddListener ( logClientSendMessage, (void *) pClient );
return (void *) pClient;
}