mirror of
https://github.com/Kiritow/GSock.git
synced 2024-03-22 13:10:51 +08:00
Fix bug in epoll::del(...)
This commit is contained in:
parent
5071f615f2
commit
3bad71c8c9
|
@ -1723,12 +1723,9 @@ int epoll::mod(vsock& v, int event)
|
||||||
ev.data.ptr = &v;
|
ev.data.ptr = &v;
|
||||||
return epoll_ctl(_fd, EPOLL_CTL_MOD, v._vp->sfd, &ev);
|
return epoll_ctl(_fd, EPOLL_CTL_MOD, v._vp->sfd, &ev);
|
||||||
}
|
}
|
||||||
int epoll::del(vsock& v, int event)
|
int epoll::del(vsock& v)
|
||||||
{
|
{
|
||||||
struct epoll_event ev;
|
return epoll_ctl(_fd, EPOLL_CTL_DEL, v._vp->sfd, NULL);
|
||||||
ev.events = event;
|
|
||||||
ev.data.ptr = &v;
|
|
||||||
return epoll_ctl(_fd, EPOLL_CTL_DEL, v._vp->sfd, &ev);
|
|
||||||
}
|
}
|
||||||
int epoll::wait(int timeout)
|
int epoll::wait(int timeout)
|
||||||
{
|
{
|
||||||
|
|
3
gsock.h
3
gsock.h
|
@ -354,9 +354,10 @@ class epoll
|
||||||
public:
|
public:
|
||||||
epoll(int MaxListen);
|
epoll(int MaxListen);
|
||||||
// EPOLLIN, EPOLLOUT, ...
|
// EPOLLIN, EPOLLOUT, ...
|
||||||
|
// Use EPOLLET to set Edge Trigger Mode
|
||||||
int add(vsock& v,int event);
|
int add(vsock& v,int event);
|
||||||
int mod(vsock& v,int event);
|
int mod(vsock& v,int event);
|
||||||
int del(vsock& v,int event);
|
int del(vsock& v);
|
||||||
|
|
||||||
// >0: Event counts.
|
// >0: Event counts.
|
||||||
// =0: Timeout.
|
// =0: Timeout.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user