summaryrefslogtreecommitdiff
path: root/poll.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 /poll.c
parentbd6999b4a2b60fdd4e2e317ca84d382f2b9b0ace (diff)
downloadlibevent-3ba224dbd5e5e482bb2be47fa704beff46540a28.tar.gz
fixes for threaded operations from Andrew Danforth
svn:r129
Diffstat (limited to 'poll.c')
-rw-r--r--poll.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/poll.c b/poll.c
index ec2366d8..f34451c2 100644
--- a/poll.c
+++ b/poll.c
@@ -65,7 +65,7 @@ struct pollop {
struct pollfd *event_set;
struct event **event_back;
sigset_t evsigmask;
-} pollop;
+};
void *poll_init (void);
int poll_add (void *, struct event *);
@@ -85,15 +85,18 @@ struct eventop pollops = {
void *
poll_init(void)
{
+ struct pollop *pollop;
+
/* Disable kqueue when this environment variable is set */
if (getenv("EVENT_NOPOLL"))
return (NULL);
- memset(&pollop, 0, sizeof(pollop));
+ if (!(pollop = calloc(1, sizeof(struct pollop))))
+ return (NULL);
- evsignal_init(&pollop.evsigmask);
+ evsignal_init(&pollop->evsigmask);
- return (&pollop);
+ return (pollop);
}
/*