Lines Matching refs:event
74 static int on_home_inotify(sd_event_source *s, const struct inotify_event *event, void *userdata);
107 r = sd_event_add_inotify(m->event, &m->inotify_event_source, get_home_root(), in manager_watch_home()
119 static int on_home_inotify(sd_event_source *s, const struct inotify_event *event, void *userdata) { in on_home_inotify() argument
125 assert(event); in on_home_inotify()
127 … if ((event->mask & (IN_Q_OVERFLOW|IN_MOVE_SELF|IN_DELETE_SELF|IN_IGNORED|IN_UNMOUNT)) != 0) { in on_home_inotify()
129 if (FLAGS_SET(event->mask, IN_Q_OVERFLOW)) in on_home_inotify()
131 else if (FLAGS_SET(event->mask, IN_MOVE_SELF)) in on_home_inotify()
133 else if (FLAGS_SET(event->mask, IN_DELETE_SELF)) in on_home_inotify()
135 else if (FLAGS_SET(event->mask, IN_UNMOUNT)) in on_home_inotify()
137 else if (FLAGS_SET(event->mask, IN_IGNORED)) in on_home_inotify()
149 if (isempty(event->name)) in on_home_inotify()
151 e = endswith(event->name, FLAGS_SET(event->mask, IN_ISDIR) ? ".homedir" : ".home"); in on_home_inotify()
155 n = strndupa_safe(event->name, e - event->name); in on_home_inotify()
159 j = path_join(get_home_root(), event->name); in on_home_inotify()
163 if ((event->mask & (IN_CREATE|IN_CLOSE_WRITE|IN_MOVED_TO)) != 0) { in on_home_inotify()
164 if (FLAGS_SET(event->mask, IN_CREATE)) in on_home_inotify()
166 else if (FLAGS_SET(event->mask, IN_CLOSE_WRITE)) in on_home_inotify()
168 else if (FLAGS_SET(event->mask, IN_MOVED_TO)) in on_home_inotify()
171 (void) manager_assess_image(m, -1, get_home_root(), event->name); in on_home_inotify()
175 if ((event->mask & (IN_DELETE | IN_CLOSE_WRITE | IN_MOVED_FROM)) != 0) { in on_home_inotify()
178 if (FLAGS_SET(event->mask, IN_DELETE)) in on_home_inotify()
180 else if (FLAGS_SET(event->mask, IN_CLOSE_WRITE)) in on_home_inotify()
182 else if (FLAGS_SET(event->mask, IN_MOVED_FROM)) in on_home_inotify()
214 r = sd_event_default(&m->event); in manager_new()
218 r = sd_event_add_signal(m->event, NULL, SIGINT, NULL, NULL); in manager_new()
222 r = sd_event_add_signal(m->event, NULL, SIGTERM, NULL, NULL); in manager_new()
226 (void) sd_event_set_watchdog(m->event, true); in manager_new()
268 m->event = sd_event_unref(m->event); in manager_free()
970 r = sd_bus_attach_event(m->bus, m->event, 0); in manager_connect_bus()
1018 r = varlink_server_attach_event(m->varlink_server, m->event, SD_EVENT_PRIORITY_NORMAL); in manager_bind_varlink()
1193 … r = sd_event_add_io(m->event, &m->notify_socket_event_source, fd, EPOLLIN, on_notify_socket, m); in manager_listen_notify()
1317 r = sd_device_monitor_attach_event(m->device_monitor, m->event); in manager_watch_devices()
1717 if (!m->event) in manager_enqueue_rescan()
1720 if (IN_SET(sd_event_get_state(m->event), SD_EVENT_FINISHED, SD_EVENT_EXITING)) in manager_enqueue_rescan()
1723 r = sd_event_add_defer(m->event, &m->deferred_rescan_event_source, on_deferred_rescan, m); in manager_enqueue_rescan()
1754 if (!m->event) in manager_enqueue_gc()
1757 if (IN_SET(sd_event_get_state(m->event), SD_EVENT_FINISHED, SD_EVENT_EXITING)) in manager_enqueue_gc()
1771 r = sd_event_add_defer(m->event, &m->deferred_gc_event_source, on_deferred_gc, m); in manager_enqueue_gc()
2132 …r = sd_event_add_time(m->event, &m->rebalance_event_source, CLOCK_MONOTONIC, 0, USEC_PER_SEC, on_r… in manager_schedule_rebalance()
2173 …r = sd_event_add_time_relative(m->event, &m->rebalance_event_source, CLOCK_MONOTONIC, m->rebalance… in manager_schedule_rebalance()