Lines Matching defs:wctx
91 struct snotify_watch_ctx *wctx;
298 len = read(snctx->wctx->inotify_fd, ev_buf, sizeof(ev_buf));
324 if (snctx->wctx->dir_wd == in_event->wd) {
336 } else if (snctx->wctx->file_wd == in_event->wd) {
361 struct snotify_watch_ctx *wctx;
363 wctx = talloc_get_type(memptr, struct snotify_watch_ctx);
364 if (wctx == NULL) {
375 if (wctx->inotify_fd != -1) {
377 "Closing inotify fd %d\n", wctx->inotify_fd);
378 close(wctx->inotify_fd);
427 struct snotify_watch_ctx *wctx;
430 wctx = talloc_zero(snctx, struct snotify_watch_ctx);
431 if (wctx == NULL) {
434 wctx->inotify_fd = -1;
435 wctx->dir_wd = -1;
436 wctx->file_wd = -1;
437 wctx->snctx = snctx;
438 talloc_set_destructor((TALLOC_CTX *)wctx, watch_ctx_destructor);
440 wctx->inotify_fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
441 if (wctx->inotify_fd == -1) {
447 DEBUG(SSSDBG_TRACE_INTERNAL, "Opened inotify fd %d\n", wctx->inotify_fd);
449 wctx->tfd = tevent_add_fd(snctx->ev, wctx, wctx->inotify_fd,
452 if (wctx->tfd == NULL) {
459 wctx->file_wd = inotify_add_watch(wctx->inotify_fd, snctx->filename, mask);
460 if (wctx->file_wd == -1) {
469 DEBUG(SSSDBG_TRACE_INTERNAL, "Opened file watch %d\n", wctx->file_wd);
476 wctx->dir_wd = inotify_add_watch(wctx->inotify_fd,
478 if (wctx->dir_wd == -1) {
486 "Opened directory watch %d\n", wctx->dir_wd);
489 return wctx;
492 talloc_free(wctx);
498 talloc_free(snctx->wctx);
500 snctx->wctx = snotify_watch(snctx, snctx->cb.mask);
501 if (snctx->wctx == NULL) {
545 snctx->wctx = snotify_watch(snctx, mask);
546 if (snctx->wctx == NULL) {