Tidy up _lwevent_activate() since it is no longer used for modification

This commit is contained in:
Laurence Withers 2007-10-26 13:21:15 +00:00
parent 5ed8cef02f
commit dfb8feedfd
1 changed files with 5 additions and 7 deletions

View File

@ -8,18 +8,16 @@
/* _lwevent_activate()
* Activates the event `ev'. Called with EPOLL_CTL_ADD in `op' when creating a new event in
* lwevent_new() or when reactivating an event in lwevent_reactivate(). Called with EPOLL_CTL_MOD
* in lwevent_set_events(). Calls epoll_ctl(), returning -1 on permanent failure.
* Activates the event `ev'. Calls epoll_ctl(), returning -1 on permanent failure.
*/
static int _lwevent_activate(int op, struct lwevent* ev)
static int _lwevent_activate(struct lwevent* ev)
{
struct epoll_event ee;
ee.events = ev->events;
ee.data.ptr = ev;
return TEMP_FAILURE_RETRY( epoll_ctl(lwevent_epoll_fd, op, ev->fd, &ee) );
return TEMP_FAILURE_RETRY( epoll_ctl(lwevent_epoll_fd, EPOLL_CTL_ADD, ev->fd, &ee) );
}
@ -39,7 +37,7 @@ struct lwevent* lwevent_new(int fd, int events, lwevent_callback callback)
ev->events = events;
ev->callback = callback;
if(_lwevent_activate(EPOLL_CTL_ADD, ev)) {
if(_lwevent_activate(ev)) {
free(ev);
return 0;
}
@ -80,7 +78,7 @@ int lwevent_deactivate(struct lwevent* ev)
*/
int lwevent_reactivate(struct lwevent* ev)
{
return _lwevent_activate(EPOLL_CTL_ADD, ev);
return _lwevent_activate(ev);
}