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 /select.c | |
parent | bd6999b4a2b60fdd4e2e317ca84d382f2b9b0ace (diff) | |
download | libevent-3ba224dbd5e5e482bb2be47fa704beff46540a28.tar.gz |
fixes for threaded operations from Andrew Danforth
svn:r129
Diffstat (limited to 'select.c')
-rw-r--r-- | select.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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); } /* |