diff --git a/src/evt_core.c b/src/evt_core.c index 01a7d7f..c87680b 100644 --- a/src/evt_core.c +++ b/src/evt_core.c @@ -173,10 +173,13 @@ void evt_core_loop(struct evt_core_ctx* ctx) { fdinfo = evt_core_get_from_fd(ctx, err_fd); if (fdinfo != NULL) { - fprintf(stderr, "Clearing fd=%d on cat=%s\n", err_fd, fdinfo->cat->name); if (fdinfo->cat->err_cb != NULL) { - while (fdinfo->cat->err_cb(ctx, fdinfo) == 0); + if (fdinfo->cat->err_cb(ctx, fdinfo) == 1) { + fprintf(stderr, "fd=%d on cat=%s is handled by app\n", err_fd, fdinfo->cat->name); + continue; + } } + fprintf(stderr, "Clearing fd=%d on cat=%s\n", err_fd, fdinfo->cat->name); evt_core_rm_fd (ctx, err_fd); } else { fprintf(stderr, "The file descriptor %d is not registered in a category, this is probably a logic error\n", err_fd); diff --git a/src/meas_lat.c b/src/meas_lat.c index f23c7e5..38a0d5c 100644 --- a/src/meas_lat.c +++ b/src/meas_lat.c @@ -43,6 +43,10 @@ void free_mesure_conf(void* v) { free(mc); } +int on_udp_err(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { + return 1; +} + int on_udp(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { ssize_t res; int secs, nsecs; @@ -121,7 +125,7 @@ void register_categories(struct evt_core_ctx* evts) { .app_ctx = NULL, .free_app_ctx = NULL, .cb = on_udp, - .err_cb = NULL, + .err_cb = on_udp_err, .name = "udp-read", .flags = EPOLLIN | EPOLLET, .socklist = NULL