diff options
author | Niels Provos <provos@gmail.com> | 2005-01-03 18:58:40 +0000 |
---|---|---|
committer | Niels Provos <provos@gmail.com> | 2005-01-03 18:58:40 +0000 |
commit | 3ba224dbd5e5e482bb2be47fa704beff46540a28 (patch) | |
tree | b91fa0d49e51260c12cd9e35dd01376ad8c69166 /poll.c | |
parent | bd6999b4a2b60fdd4e2e317ca84d382f2b9b0ace (diff) | |
download | libevent-3ba224dbd5e5e482bb2be47fa704beff46540a28.tar.gz |
fixes for threaded operations from Andrew Danforth
svn:r129
Diffstat (limited to 'poll.c')
-rw-r--r-- | poll.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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); } /* |