From 4e220d8fd6b11f186f38a81743d9e29659f4f479 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Thu, 28 Feb 2002 15:34:28 +0000 Subject: [PATCH] call atexit only if successful --- src/libCom/error/errlog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libCom/error/errlog.c b/src/libCom/error/errlog.c index 3ed392f07..e1965e038 100644 --- a/src/libCom/error/errlog.c +++ b/src/libCom/error/errlog.c @@ -323,8 +323,10 @@ static void errlogInitPvt(void *arg) tid = epicsThreadCreate("errlog",epicsThreadPriorityLow, epicsThreadGetStackSize(epicsThreadStackSmall), (EPICSTHREADFUNC)errlogTask,0); - atexit(exitHandler); - if(tid) pvtData.errlogInitFailed = FALSE; + if(tid) { + pvtData.errlogInitFailed = FALSE; + atexit(exitHandler); + } } epicsShareFunc int epicsShareAPI errlogInit(int bufsize)