res = kevent(kq_fd, changes, nchanges, NULL, 0, NULL);
if (res < 0) {
log_module(MAIN_LOG, LOG_ERROR, "kevent() add failed: %s", strerror(errno));
res = kevent(kq_fd, changes, nchanges, NULL, 0, NULL);
if (res < 0) {
log_module(MAIN_LOG, LOG_ERROR, "kevent() add failed: %s", strerror(errno));