[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b
aCaB
acab at clamav.net
Sun Apr 4 01:18:16 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit e4bf8f94552ef45409ae580250c32c5fa07a94ee
Author: aCaB <acab at clamav.net>
Date: Sat Jan 30 21:42:35 2010 +0100
fix concurrency issue
diff --git a/win32/compat/net.c b/win32/compat/net.c
index 8458b3a..a7a586d 100644
--- a/win32/compat/net.c
+++ b/win32/compat/net.c
@@ -388,7 +388,7 @@ VOID CALLBACK poll_cb(PVOID param, BOOLEAN timedout) {
}
int poll_with_event(struct pollfd *fds, int nfds, int timeout, HANDLE event) {
- HANDLE *setme;
+ HANDLE *setme, cankill;
struct w32polldata *items;
unsigned int i, ret = 0;
@@ -421,12 +421,16 @@ int poll_with_event(struct pollfd *fds, int nfds, int timeout, HANDLE event) {
} else {
ret = 0;
}
+ cankill = CreateEvent(NULL, TRUE, FALSE, NULL);
for(i=0; i<nfds; i++) {
- UnregisterWait(items[i].waiter);
+ ResetEvent(cankill);
+ UnregisterWaitEx(items[i].waiter, cankill);
WSAEventSelect(fds[i].fd, items[i].event, 0);
+ WaitForSingleObject(cankill, INFINITE);
CloseHandle(items[i].event);
ret += (items[i].polldata->revents != 0);
}
+ CloseHandle(cankill);
free(items);
CloseHandle(setme[0]);
free(setme);
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list