From bbefbee0d02e49326ff5757061cde2f26ad088d4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 13 Apr 2012 12:13:50 +0200 Subject: imuxsock: mini bugfix: closed fd was tried to close a second time --- plugins/imuxsock/imuxsock.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index ca762d64..c97e6b28 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -458,7 +458,8 @@ createLogSocket(lstn_t *pLstn) chmod((char*)pLstn->sockName, 0666) < 0) { errmsg.LogError(errno, NO_ERRCODE, "cannot create '%s'", pLstn->sockName); dbgprintf("cannot create %s (%d).\n", pLstn->sockName, errno); - close(pLstn->fd); + if(pLstn->fd != -1) + close(pLstn->fd); pLstn->fd = -1; ABORT_FINALIZE(RS_RET_ERR_CRE_AFUX); } @@ -528,8 +529,10 @@ openLogSocket(lstn_t *pLstn) finalize_it: if(iRet != RS_RET_OK) { - close(pLstn->fd); - pLstn->fd = -1; + if(pLstn->fd != -1) { + close(pLstn->fd); + pLstn->fd = -1; + } } RETiRet; -- cgit v1.2.3