Skip to content
Snippets Groups Projects
Verified Commit 59e7d2d7 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Return 0 when epoll_ctl is successful

parent 371cde00
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ impl PalEpoll for Sys { ...@@ -23,7 +23,7 @@ impl PalEpoll for Sys {
fn epoll_ctl(epfd: c_int, op: c_int, fd: c_int, event: *mut epoll_event) -> c_int { fn epoll_ctl(epfd: c_int, op: c_int, fd: c_int, event: *mut epoll_event) -> c_int {
match op { match op {
EPOLL_CTL_ADD | EPOLL_CTL_MOD => { EPOLL_CTL_ADD | EPOLL_CTL_MOD => {
Sys::write( if Sys::write(
epfd, epfd,
&Event { &Event {
id: fd as usize, id: fd as usize,
...@@ -33,10 +33,15 @@ impl PalEpoll for Sys { ...@@ -33,10 +33,15 @@ impl PalEpoll for Sys {
// systems. If this is needed, use a box or something // systems. If this is needed, use a box or something
data: unsafe { (*event).data.u64 as usize }, data: unsafe { (*event).data.u64 as usize },
}, },
) as c_int ) < 0
{
-1
} else {
0
}
} }
EPOLL_CTL_DEL => { EPOLL_CTL_DEL => {
Sys::write( if Sys::write(
epfd, epfd,
&Event { &Event {
id: fd as usize, id: fd as usize,
...@@ -44,11 +49,16 @@ impl PalEpoll for Sys { ...@@ -44,11 +49,16 @@ impl PalEpoll for Sys {
//TODO: Is data required? //TODO: Is data required?
data: 0, data: 0,
}, },
) as c_int ) < 0
{
-1
} else {
0
}
} }
_ => { _ => {
platform::ERRNO.set(EINVAL); platform::ERRNO.set(EINVAL);
return -1; -1
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment