mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 05:14:46 -04:00
some fixes from openbsd via brad
svn:r207
This commit is contained in:
parent
682d598ada
commit
7517ef2a81
5
event.c
5
event.c
@ -48,6 +48,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <signal.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
@ -109,8 +110,8 @@ struct event_list signalqueue;
|
|||||||
struct event_base *current_base = NULL;
|
struct event_base *current_base = NULL;
|
||||||
|
|
||||||
/* Handle signals - This is a deprecated interface */
|
/* Handle signals - This is a deprecated interface */
|
||||||
int (*event_sigcb)(void); /* Signal callback when gotsig is set */
|
int (*event_sigcb)(void); /* Signal callback when gotsig is set */
|
||||||
volatile int event_gotsig; /* Set in signal handler */
|
volatile sig_atomic_t event_gotsig; /* Set in signal handler */
|
||||||
|
|
||||||
/* Prototypes */
|
/* Prototypes */
|
||||||
static void event_queue_insert(struct event_base *, struct event *, int);
|
static void event_queue_insert(struct event_base *, struct event *, int);
|
||||||
|
6
poll.c
6
poll.c
@ -75,7 +75,7 @@ int poll_del (void *, struct event *);
|
|||||||
int poll_recalc (struct event_base *, void *, int);
|
int poll_recalc (struct event_base *, void *, int);
|
||||||
int poll_dispatch (struct event_base *, void *, struct timeval *);
|
int poll_dispatch (struct event_base *, void *, struct timeval *);
|
||||||
|
|
||||||
struct eventop pollops = {
|
const struct eventop pollops = {
|
||||||
"poll",
|
"poll",
|
||||||
poll_init,
|
poll_init,
|
||||||
poll_add,
|
poll_add,
|
||||||
@ -89,7 +89,7 @@ poll_init(void)
|
|||||||
{
|
{
|
||||||
struct pollop *pollop;
|
struct pollop *pollop;
|
||||||
|
|
||||||
/* Disable kqueue when this environment variable is set */
|
/* Disable poll when this environment variable is set */
|
||||||
if (getenv("EVENT_NOPOLL"))
|
if (getenv("EVENT_NOPOLL"))
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ poll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
|
|||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
for (i = 0; i < nfds; i++) {
|
for (i = 0; i < nfds; i++) {
|
||||||
int what = pop->event_set[i].revents;
|
int what = pop->event_set[i].revents;
|
||||||
struct event *r_ev = NULL, *w_ev = NULL;
|
struct event *r_ev = NULL, *w_ev = NULL;
|
||||||
if (!what)
|
if (!what)
|
||||||
continue;
|
continue;
|
||||||
|
2
select.c
2
select.c
@ -93,7 +93,7 @@ select_init(void)
|
|||||||
{
|
{
|
||||||
struct selectop *sop;
|
struct selectop *sop;
|
||||||
|
|
||||||
/* Disable kqueue when this environment variable is set */
|
/* Disable select when this environment variable is set */
|
||||||
if (getenv("EVENT_NOSELECT"))
|
if (getenv("EVENT_NOSELECT"))
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user