Changeset 33b7efe6ca32e4a2a683db89cf86828a9b1ab096

Show
Ignore:
Timestamp:
11/09/11 00:12:54 (2 years ago)
Author:
Dan Di Spaltro <dan@cloudkick.com>
git-committer:
Dan Di Spaltro <dan@cloudkick.com> 1320797574 -0800
git-parent:

[fbf2b3181e1cc48410fe39bb0f0c291d73095a8f]

git-author:
Dan Di Spaltro <dan@cloudkick.com> 1320727127 -0800
Message:

Assert when result is not 0
Fix usage where we re-add an already added event.
Fix usage where we remove after closing, change the order in that case

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/eventer/eventer_epoll_impl.c

    rcd97caa r33b7efe  
    114114  master_fds[e->fd].e = e; 
    115115 
    116   epoll_ctl(epoll_fd, EPOLL_CTL_ADD, e->fd, &_ev); 
     116  assert(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, e->fd, &_ev) == 0); 
    117117 
    118118  release_master_fd(e->fd, lockstate); 
     
    132132      removed = e; 
    133133      master_fds[e->fd].e = NULL; 
    134       epoll_ctl(epoll_fd, EPOLL_CTL_DEL, e->fd, &_ev); 
     134      assert(epoll_ctl(epoll_fd, EPOLL_CTL_DEL, e->fd, &_ev) == 0); 
    135135    } 
    136136    release_master_fd(e->fd, lockstate); 
     
    160160    if(e->mask & EVENTER_WRITE) _ev.events |= (EPOLLOUT); 
    161161    if(e->mask & EVENTER_EXCEPTION) _ev.events |= (EPOLLERR|EPOLLHUP); 
    162     epoll_ctl(epoll_fd, EPOLL_CTL_MOD, e->fd, &_ev); 
     162    assert(epoll_ctl(epoll_fd, EPOLL_CTL_MOD, e->fd, &_ev) == 0); 
    163163  } 
    164164} 
     
    173173    eiq = master_fds[fd].e; 
    174174    master_fds[fd].e = NULL; 
    175     epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd, &_ev); 
     175    assert(epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd, &_ev) == 0); 
    176176    release_master_fd(fd, lockstate); 
    177177  } 
     
    208208    if(newmask & EVENTER_WRITE) _ev.events |= (EPOLLOUT); 
    209209    if(newmask & EVENTER_EXCEPTION) _ev.events |= (EPOLLERR|EPOLLHUP); 
    210     epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd, &_ev); 
     210    assert(epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd, &_ev) == 0); 
    211211    /* Set our mask */ 
    212212    e->mask = newmask; 
  • src/modules/check_test.c

    rde645be r33b7efe  
    191191   
    192192    if(conne) { 
    193       eventer_add(conne); 
     193      // The event already exists, why re-add it?  Did we want to update it? 
     194      //eventer_add(conne); 
    194195      eventer_trigger(conne, EVENTER_READ | EVENTER_WRITE); 
    195196    } 
  • src/modules/lua.c

    r82dc7d3 r33b7efe  
    102102  eventer_t removed, e = *value; 
    103103  noitL(nldeb, "lua check cleanup: dropping (%p)->fd (%d)\n", e, e->fd); 
     104  removed = eventer_remove(e); 
     105  noitL(nldeb, "    remove from eventer system %s\n", 
     106        removed ? "succeeded" : "failed"); 
    104107  if(e->mask & (EVENTER_READ|EVENTER_WRITE|EVENTER_EXCEPTION)) { 
    105108    noitL(nldeb, "    closing down fd %d\n", e->fd); 
    106109    e->opset->close(e->fd, &mask, e); 
    107110  } 
    108   removed = eventer_remove(e); 
    109   noitL(nldeb, "    remove from eventer system %s\n", 
    110         removed ? "succeeded" : "failed"); 
    111111  if(e->closure) { 
    112112    struct nl_generic_cl *cl;