summaryrefslogtreecommitdiff
path: root/select.c
diff options
context:
space:
mode:
authorNiels Provos <provos@gmail.com>2005-01-03 18:58:40 +0000
committerNiels Provos <provos@gmail.com>2005-01-03 18:58:40 +0000
commit3ba224dbd5e5e482bb2be47fa704beff46540a28 (patch)
treeb91fa0d49e51260c12cd9e35dd01376ad8c69166 /select.c
parentbd6999b4a2b60fdd4e2e317ca84d382f2b9b0ace (diff)
downloadlibevent-3ba224dbd5e5e482bb2be47fa704beff46540a28.tar.gz
fixes for threaded operations from Andrew Danforth
svn:r129
Diffstat (limited to 'select.c')
-rw-r--r--select.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/select.c b/select.c
index 865f2427..f1353427 100644
--- a/select.c
+++ b/select.c
@@ -69,7 +69,7 @@ struct selectop {
fd_set *event_readset;
fd_set *event_writeset;
sigset_t evsigmask;
-} sop;
+};
void *select_init (void);
int select_add (void *, struct event *);
@@ -89,15 +89,18 @@ const struct eventop selectops = {
void *
select_init(void)
{
+ struct selectop *sop;
+
/* Disable kqueue when this environment variable is set */
if (getenv("EVENT_NOSELECT"))
return (NULL);
- memset(&sop, 0, sizeof(sop));
+ if (!(sop = calloc(1, sizeof(struct selectop))))
+ return (NULL);
- evsignal_init(&sop.evsigmask);
+ evsignal_init(&sop->evsigmask);
- return (&sop);
+ return (sop);
}
/*