Lines Matching refs:file_ctx
133 typedef int (*monitor_reconf_fn)(struct config_file_ctx *file_ctx,
169 struct config_file_ctx *file_ctx;
723 static int monitor_update_resolv(struct config_file_ctx *file_ctx,
730 mt_ctx = file_ctx->mt_ctx;
1730 struct config_file_ctx *file_ctx,
1733 static errno_t create_poll_timer(struct config_file_ctx *file_ctx)
1741 file_ctx->poll_check.timer = tevent_add_timer(file_ctx->mt_ctx->ev,
1742 file_ctx->poll_check.parent_ctx,
1745 file_ctx);
1746 if (!file_ctx->poll_check.timer) {
1747 talloc_free(file_ctx);
1760 struct config_file_ctx *file_ctx;
1763 file_ctx = talloc_get_type(ptr, struct config_file_ctx);
1765 for (cb = file_ctx->poll_check.callbacks; cb; cb = cb->next) {
1784 cb->fn(file_ctx, cb->filename);
1788 ret = create_poll_timer(file_ctx);
1799 struct config_file_ctx *file_ctx;
1804 file_ctx = talloc_get_type(pvt, struct config_file_ctx);
1805 if (file_ctx == NULL) {
1809 return file_ctx->fn(file_ctx, filename);
1812 static int try_inotify(struct config_file_ctx *file_ctx,
1824 snctx = snotify_create(file_ctx, file_ctx->mt_ctx->ev, SNOTIFY_WATCH_DIR,
1828 resolv_conf_inotify_cb, file_ctx);
1847 if (!ctx->file_ctx) {
1848 ctx->file_ctx = talloc_zero(mem_ctx, struct config_file_ctx);
1849 if (!ctx->file_ctx) return ENOMEM;
1851 ctx->file_ctx->mt_ctx = ctx;
1852 ctx->file_ctx->fn = fn;
1860 talloc_free(ctx->file_ctx);
1865 ret = try_inotify(ctx->file_ctx, file);
1873 ret = monitor_config_file_fallback(mem_ctx, ctx->file_ctx, file);
1880 struct config_file_ctx *file_ctx,
1905 file_ctx->poll_check.parent_ctx = parent_ctx;
1907 cb = talloc_zero(file_ctx, struct config_file_callback);
1909 talloc_free(file_ctx);
1914 talloc_free(file_ctx);
1917 cb->fn = file_ctx->fn;
1920 DLIST_ADD(file_ctx->poll_check.callbacks, cb);
1922 if(!file_ctx->poll_check.timer) {
1923 ret = create_poll_timer(file_ctx);