Lines Matching defs:watchdog_ctx
31 struct watchdog_ctx {
43 } watchdog_ctx;
50 prev_time = watchdog_ctx.timestamp;
51 cur_time = watchdog_ctx.timestamp = time(NULL);
54 if (write(watchdog_ctx.pipefd[1], "1", 1) != 1) {
75 if (__sync_add_and_fetch(&watchdog_ctx.ticks, 1) > WATCHDOG_MAX_TICKS) {
86 __sync_and_and_fetch(&watchdog_ctx.ticks, 0);
98 watchdog_ctx.te = tevent_add_timer(ev, ev,
99 tevent_timeval_current_ofs(watchdog_ctx.interval.tv_sec, 0),
103 if (!watchdog_ctx.te) {
138 ret = watchdog_fd_recv_data(watchdog_ctx.pipefd[0]);
157 ret = setup_watchdog(watchdog_ctx.ev, watchdog_ctx.input_interval);
182 sev.sigev_value.sival_ptr = &watchdog_ctx.timerid;
184 ret = timer_create(CLOCK_MONOTONIC, &sev, &watchdog_ctx.timerid);
196 watchdog_ctx.interval.tv_sec = interval;
197 watchdog_ctx.interval.tv_usec = 0;
199 watchdog_ctx.ev = ev;
200 watchdog_ctx.input_interval = interval;
201 watchdog_ctx.timestamp = time(NULL);
203 ret = pipe(watchdog_ctx.pipefd);
211 sss_fd_nonblocking(watchdog_ctx.pipefd[0]);
212 sss_fd_nonblocking(watchdog_ctx.pipefd[1]);
214 tfd = tevent_add_fd(ev, (TALLOC_CTX *)ev, watchdog_ctx.pipefd[0],
216 watchdog_ctx.tfd = tfd;
225 ret = timer_settime(watchdog_ctx.timerid, 0, &its, NULL);
246 ret = timer_delete(watchdog_ctx.timerid);
255 talloc_zfree(watchdog_ctx.tfd);
258 PIPE_FD_CLOSE(watchdog_ctx.pipefd[0]);
259 PIPE_FD_CLOSE(watchdog_ctx.pipefd[1]);
262 talloc_free(watchdog_ctx.te);