- /*
- * Initial condition need to update the last counter and sample time, but
- * should not check health in this initial case, because we don't know how
- * much time has passed.
- */
- if (state->last_time.tv_sec == 0 && state->last_time.tv_nsec == 0) {
- /* update last counter and last sample time */
- state->last = current;
- memcpy(&state->last_time, ¤t_time, sizeof(current_time));
- } else {
- if (time_diff_gt(¤t_time, &state->last_time, &time_delta)) {
- if (current == last && !HEALTH_IS_IN_POLL(current)) {
- /* error */
- retval = 0;
- }
- /* update last counter and last sample time */
- state->last = current;
- memcpy(&state->last_time, ¤t_time, sizeof(current_time));
+ /* Add the application registration socket */
+ ret = lttng_poll_add(&events, sock, LPOLLIN | LPOLLPRI);
+ if (ret < 0) {
+ goto error;
+ }