summaryrefslogtreecommitdiffstats
path: root/runtime/net.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-09-30 15:57:10 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-09-30 15:57:10 +0200
commite30fe2842e3ce9f06098c18f0f962596059684ca (patch)
treefc9bb5262e2ab674d8540e8a3183c956537f3144 /runtime/net.c
parent5a1a73b4326d97789b5640225be0e25cb8dd8de7 (diff)
downloadrsyslog-e30fe2842e3ce9f06098c18f0f962596059684ca.tar.gz
rsyslog-e30fe2842e3ce9f06098c18f0f962596059684ca.tar.xz
rsyslog-e30fe2842e3ce9f06098c18f0f962596059684ca.zip
prevent getnameinfo() from being cancelled
... but removed the mutex, as the problem seems to be in cancel processing, so the mutex is no longer necessary
Diffstat (limited to 'runtime/net.c')
-rw-r--r--runtime/net.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/net.c b/runtime/net.c
index 892edf4a..31b02f1a 100644
--- a/runtime/net.c
+++ b/runtime/net.c
@@ -685,11 +685,14 @@ mygetnameinfo(const struct sockaddr *sa, socklen_t salen,
char *serv, size_t servlen, int flags)
{
static pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
+ int iCancelStateSave;
int i;
- pthread_mutex_lock(&mut);
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave);
+ //pthread_mutex_lock(&mut);
i = getnameinfo(sa, salen, host, hostlen, serv, servlen, flags);
- pthread_mutex_unlock(&mut);
+ //pthread_mutex_unlock(&mut);
+ pthread_setcancelstate(iCancelStateSave, NULL);
return i;
}