Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
67669f00
Commit
67669f00
authored
Dec 16, 2009
by
antirez
Browse files
Fixed a lame epoll issue
parent
163f4b8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
ae_epoll.c
View file @
67669f00
...
@@ -29,10 +29,13 @@ static void aeApiFree(aeEventLoop *eventLoop) {
...
@@ -29,10 +29,13 @@ static void aeApiFree(aeEventLoop *eventLoop) {
static
int
aeApiAddEvent
(
aeEventLoop
*
eventLoop
,
int
fd
,
int
mask
)
{
static
int
aeApiAddEvent
(
aeEventLoop
*
eventLoop
,
int
fd
,
int
mask
)
{
aeApiState
*
state
=
eventLoop
->
apidata
;
aeApiState
*
state
=
eventLoop
->
apidata
;
struct
epoll_event
ee
;
struct
epoll_event
ee
;
/* If the fd was already monitored for some event, we need a MOD
* operation. Otherwise we need an ADD operation. */
int
op
=
eventLoop
->
events
[
fd
].
mask
==
AE_NONE
?
int
op
=
eventLoop
->
events
[
fd
].
mask
==
AE_NONE
?
EPOLL_CTL_ADD
:
EPOLL_CTL_MOD
;
EPOLL_CTL_ADD
:
EPOLL_CTL_MOD
;
ee
.
events
=
0
;
ee
.
events
=
0
;
mask
|=
eventLoop
->
events
[
fd
].
mask
;
/* Merge old events */
if
(
mask
&
AE_READABLE
)
ee
.
events
|=
EPOLLIN
;
if
(
mask
&
AE_READABLE
)
ee
.
events
|=
EPOLLIN
;
if
(
mask
&
AE_WRITABLE
)
ee
.
events
|=
EPOLLOUT
;
if
(
mask
&
AE_WRITABLE
)
ee
.
events
|=
EPOLLOUT
;
if
(
mask
&
AE_EXCEPTION
)
ee
.
events
|=
EPOLLPRI
;
if
(
mask
&
AE_EXCEPTION
)
ee
.
events
|=
EPOLLPRI
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment