diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-04-13 09:12:41 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-04-13 09:12:41 +0200 |
commit | 2ab2eeafa838de7053e626a6610e775232dc67b9 (patch) | |
tree | 82260c10527abbdf69580c69590b5b05d3486615 /plugins | |
parent | d91af378bd69e36dc1e76c4bfcf78c6fe33ba355 (diff) | |
download | rsyslog-2ab2eeafa838de7053e626a6610e775232dc67b9.tar.gz rsyslog-2ab2eeafa838de7053e626a6610e775232dc67b9.tar.xz rsyslog-2ab2eeafa838de7053e626a6610e775232dc67b9.zip |
imuxsock: mini bugfix: closed fd was tried to close second time
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/imuxsock/imuxsock.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index a140aaad..193cbb33 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; |