mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-02 11:57:43 +08:00
fixed bugs when open_limit return -1, we should use one default value for event_select.c and event_poll.c in fiber.
This commit is contained in:
parent
9cac39c265
commit
fec4daee79
@ -259,9 +259,9 @@ EVENT *event_poll_create(int size)
|
||||
|
||||
// override size with system open limit setting
|
||||
size = open_limit(0);
|
||||
ep->size = size;
|
||||
ep->pfds = (struct pollfd *) mem_calloc(size, sizeof(struct pollfd));
|
||||
ep->files = (FILE_EVENT**) mem_calloc(size, sizeof(FILE_EVENT*));
|
||||
ep->size = size > 0 ? size : 10240;
|
||||
ep->pfds = (struct pollfd *) mem_calloc(ep->size, sizeof(struct pollfd));
|
||||
ep->files = (FILE_EVENT**) mem_calloc(ep->size, sizeof(FILE_EVENT*));
|
||||
ep->count = 0;
|
||||
|
||||
#ifdef DELAY_CALL
|
||||
|
@ -255,8 +255,8 @@ EVENT *event_select_create(int size)
|
||||
size = open_limit(0);
|
||||
es->maxfd = -1;
|
||||
es->dirty = 0;
|
||||
es->files = (FILE_EVENT**) mem_calloc(size, sizeof(FILE_EVENT*));
|
||||
es->size = size;
|
||||
es->size = size > 0 ? size : 10240;
|
||||
es->files = (FILE_EVENT**) mem_calloc(es->size, sizeof(FILE_EVENT*));
|
||||
|
||||
#ifdef DELAY_CALL
|
||||
es->r_ready = array_create(100);
|
||||
|
Loading…
Reference in New Issue
Block a user