mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 03:44:22 -04:00
Do not free the kqop file descriptor in other processes, also allow it to be 0; from Andrei Nigmatulin
svn:r682
This commit is contained in:
parent
593b5f99b3
commit
19dad16699
@ -55,6 +55,7 @@ Changes in current version:
|
||||
o test support for PUT/DELETE requests; from Josh Rotenberg
|
||||
o rewrite of the evbuffer code to reduce memory copies
|
||||
o Some older Solaris versions demand that _REENTRANT be defined to get strtok_r(); do so.
|
||||
o Do not free the kqop file descriptor in other processes, also allow it to be 0; from Andrei Nigmatulin
|
||||
|
||||
Changes in 1.4.0:
|
||||
o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr.
|
||||
|
5
kqueue.c
5
kqueue.c
@ -72,6 +72,7 @@ struct kqop {
|
||||
struct kevent *events;
|
||||
int nevents;
|
||||
int kq;
|
||||
pid_t pid;
|
||||
};
|
||||
|
||||
void *kq_init (struct event_base *);
|
||||
@ -114,6 +115,8 @@ kq_init(struct event_base *base)
|
||||
|
||||
kqueueop->kq = kq;
|
||||
|
||||
kqueueop->pid = getpid();
|
||||
|
||||
/* Initalize fields */
|
||||
kqueueop->changes = event_malloc(NEVENT * sizeof(struct kevent));
|
||||
if (kqueueop->changes == NULL) {
|
||||
@ -411,7 +414,7 @@ kq_dealloc(struct event_base *base, void *arg)
|
||||
event_free(kqop->changes);
|
||||
if (kqop->events)
|
||||
event_free(kqop->events);
|
||||
if (kqop->kq)
|
||||
if (kqop->kq >= 0 && kqop->pid == getpid())
|
||||
close(kqop->kq);
|
||||
memset(kqop, 0, sizeof(struct kqop));
|
||||
event_free(kqop);
|
||||
|
Loading…
x
Reference in New Issue
Block a user