[or-cvs] r10750: Try to fix win32 build again. (in tor/trunk: . src/common)
nickm at seul.org
nickm at seul.org
Fri Jul 6 14:17:30 UTC 2007
Author: nickm
Date: 2007-07-06 10:17:30 -0400 (Fri, 06 Jul 2007)
New Revision: 10750
Modified:
tor/trunk/
tor/trunk/src/common/compat.c
Log:
r13631 at catbus: nickm | 2007-07-06 10:17:22 -0400
Try to fix win32 build again.
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r13631] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: tor/trunk/src/common/compat.c
===================================================================
--- tor/trunk/src/common/compat.c 2007-07-06 11:53:55 UTC (rev 10749)
+++ tor/trunk/src/common/compat.c 2007-07-06 14:17:30 UTC (rev 10750)
@@ -1498,10 +1498,8 @@
tor_mutex_t *
tor_mutex_new(void)
{
- void *r;
tor_mutex_t *m = tor_malloc_zero(sizeof(tor_mutex_t));
- r = InitializeCriticalSection(&m->mutex);
- tor_assert(r != NULL);
+ InitializeCriticalSection(&m->mutex);
return m;
}
void
@@ -1653,10 +1651,7 @@
tor_cond_new(void)
{
tor_cond_t *cond = tor_malloc_zero(sizeof(tor_cond_t));
- if (!InitializeCriticalSection(&cond->mutex)) {
- tor_free(cond);
- return NULL;
- }
+ InitializeCriticalSection(&cond->mutex);
cond->events = smartlist_create();
return cond;
}
@@ -1669,7 +1664,7 @@
smartlist_free(cond->events);
tor_free(cond);
}
-void
+int
tor_cond_wait(tor_cond_t *cond, tor_mutex_t *mutex)
{
HANDLE event;
@@ -1703,6 +1698,7 @@
case WAIT_FAILED:
log_warn(LD_GENERAL, "Failed to acquire mutex: %d",(int) GetLastError());
}
+ return 0;
}
void
tor_cond_signal_one(tor_cond_t *cond)
@@ -1712,7 +1708,7 @@
EnterCriticalSection(&cond->mutex);
- if ((event = smartlist_pop_last(cond->events))
+ if ((event = smartlist_pop_last(cond->events)))
SetEvent(event);
LeaveCriticalSection(&cond->mutex);
More information about the tor-commits
mailing list