static int lxc_monitord_sock_handler(int fd, void *data, struct lxc_epoll_descr *descr) { struct lxc_monitor *mon = data; lxc_monitord_sockfd_remove(mon, fd); return 0; }
static int lxc_monitord_sock_handler(int fd, uint32_t events, void *data, struct lxc_epoll_descr *descr) { struct lxc_monitor *mon = data; if (events & EPOLLIN) { int rc; char buf[4]; rc = read(fd, buf, sizeof(buf)); if (rc > 0 && !strncmp(buf, "quit", 4)) quit = 1; } if (events & EPOLLHUP) lxc_monitord_sockfd_remove(mon, fd); return quit; }