Home
last modified time | relevance | path

Searched refs:wd (Results 1 – 18 of 18) sorted by relevance

/systemd-251/src/udev/
Dudev-watch.c45 int wd; in udev_watch_restore() local
53 if (safe_atoi(ent->d_name, &wd) < 0) in udev_watch_restore()
56 r = device_new_from_watch_handle_at(&dev, dirfd(dir), wd); in udev_watch_restore()
78 int wd, r; in udev_watch_begin() local
88 wd = inotify_add_watch(inotify_fd, devnode, IN_CLOSE_WRITE); in udev_watch_begin()
89 if (wd < 0) { in udev_watch_begin()
119 wd, devnode, FORMAT_TIMESPAN(delay, USEC_PER_MSEC)); in udev_watch_begin()
123 r = device_set_watch_handle(dev, wd); in udev_watch_begin()
132 wd, devnode); in udev_watch_begin()
134 (void) inotify_rm_watch(inotify_fd, wd); in udev_watch_begin()
[all …]
Dudevd.c1513 r = device_new_from_watch_handle(&dev, e->wd); in on_inotify()
/systemd-251/src/basic/
Dinotify-util.c8 int wd, r; in inotify_add_watch_fd() local
11 wd = inotify_add_watch(fd, FORMAT_PROC_FD_PATH(what), mask); in inotify_add_watch_fd()
12 if (wd < 0) { in inotify_add_watch_fd()
26 return wd; in inotify_add_watch_fd()
30 int wd; in inotify_add_watch_and_warn() local
32 wd = inotify_add_watch(fd, pathname, mask); in inotify_add_watch_and_warn()
33 if (wd < 0) { in inotify_add_watch_and_warn()
40 return wd; in inotify_add_watch_and_warn()
Dterminal-util.c361 int r, wd = -1; in acquire_terminal() local
380 wd = inotify_add_watch(notify, name, IN_CLOSE); in acquire_terminal()
381 if (wd < 0) in acquire_terminal()
432 assert(wd >= 0); in acquire_terminal()
466 if (e->wd != wd || !(e->mask & IN_CLOSE)) /* Safety checks */ in acquire_terminal()
/systemd-251/src/libsystemd/sd-network/
Dsd-network.c416 int wd; in monitor_add_inotify_watch() local
418 wd = inotify_add_watch(fd, "/run/systemd/netif/links/", IN_MOVED_TO|IN_DELETE); in monitor_add_inotify_watch()
419 if (wd >= 0) in monitor_add_inotify_watch()
420 return wd; in monitor_add_inotify_watch()
424 wd = inotify_add_watch(fd, "/run/systemd/netif/", IN_CREATE|IN_ISDIR); in monitor_add_inotify_watch()
425 if (wd >= 0) in monitor_add_inotify_watch()
426 return wd; in monitor_add_inotify_watch()
430 wd = inotify_add_watch(fd, "/run/systemd/", IN_CREATE|IN_ISDIR); in monitor_add_inotify_watch()
431 if (wd < 0) in monitor_add_inotify_watch()
434 return wd; in monitor_add_inotify_watch()
[all …]
/systemd-251/src/libsystemd/sd-device/
Ddevice-private.c615 int wd, r; in device_get_watch_handle() local
631 r = safe_atoi(buf, &wd); in device_get_watch_handle()
635 if (wd < 0) in device_get_watch_handle()
639 xsprintf(path_wd, "/run/udev/watch/%d", wd); in device_get_watch_handle()
647 return device->watch_handle = wd; in device_get_watch_handle()
652 int wd; in device_remove_watch_handle() local
657 wd = device_get_watch_handle(device); in device_remove_watch_handle()
658 if (wd >= 0) { in device_remove_watch_handle()
661 xsprintf(path_wd, "/run/udev/watch/%d", wd); in device_remove_watch_handle()
682 int device_set_watch_handle(sd_device *device, int wd) { in device_set_watch_handle() argument
[all …]
Ddevice-private.h15 int device_new_from_watch_handle_at(sd_device **ret, int dirfd, int wd);
16 static inline int device_new_from_watch_handle(sd_device **ret, int wd) { in device_new_from_watch_handle() argument
17 return device_new_from_watch_handle_at(ret, -1, wd); in device_new_from_watch_handle()
33 int device_set_watch_handle(sd_device *device, int wd);
/systemd-251/src/core/
Dpath.c75 int flags, wd = -1; in path_spec_watch() local
97 wd = inotify_add_watch(s->inotify_fd, s->path, f); in path_spec_watch()
98 if (wd < 0) { in path_spec_watch()
108 wd = inotify_add_watch_and_warn(s->inotify_fd, s->path, f); in path_spec_watch()
109 if (wd < 0) { in path_spec_watch()
113 r = wd; in path_spec_watch()
149 s->primary_wd = wd; in path_spec_watch()
194 if (s->primary_wd == e->wd) in path_spec_fd_event()
Ddbus-execute.c611 const char *wd; in property_get_working_directory() local
618 wd = "~"; in property_get_working_directory()
620 wd = c->working_directory; in property_get_working_directory()
623 wd = strjoina("!", wd); in property_get_working_directory()
625 return sd_bus_message_append(reply, "s", wd); in property_get_working_directory()
Dexecute.c3700 const char *d, *wd; in apply_working_directory() local
3712 wd = home; in apply_working_directory()
3715 wd = empty_to_root(context->working_directory); in apply_working_directory()
3718 d = wd; in apply_working_directory()
3720 d = prefix_roota(context->root_directory, wd); in apply_working_directory()
Dcgroup.c3276 if (e->wd < 0) in on_cgroup_inotify_event()
3287 u = hashmap_get(m->cgroup_control_inotify_wd_unit, INT_TO_PTR(e->wd)); in on_cgroup_inotify_event()
3291 u = hashmap_get(m->cgroup_memory_inotify_wd_unit, INT_TO_PTR(e->wd)); in on_cgroup_inotify_event()
/systemd-251/src/libsystemd/sd-event/
Devent-source.h180 int wd; member
207 Hashmap *wd; /* The inode_data structures keyed by the watch descriptor for each */ member
Dsd-event.c1690 assert(hashmap_isempty(d->wd)); in event_free_inotify_data()
1696 hashmap_free(d->wd); in event_free_inotify_data()
1811 if (d->wd >= 0) { in event_free_inode_data()
1818 … if (inotify_rm_watch(d->inotify_data->fd, d->wd) < 0 && errno != EINVAL) in event_free_inode_data()
1819 … log_debug_errno(errno, "Failed to remove watch descriptor %i from inotify, ignoring: %m", d->wd); in event_free_inode_data()
1822 assert_se(hashmap_remove(d->inotify_data->wd, INT_TO_PTR(d->wd)) == d); in event_free_inode_data()
1911 .wd = -1, in event_make_inode_data()
1955 int wd, r; in inode_data_realize_watch() local
1962 if (d->wd >= 0 && combined_mask == d->combined_mask) in inode_data_realize_watch()
1965 r = hashmap_ensure_allocated(&d->inotify_data->wd, NULL); in inode_data_realize_watch()
[all …]
/systemd-251/src/libsystemd/sd-bus/
Dbus-socket.c707 int wd, r; in bus_socket_inotify_setup() local
749 wd = inotify_add_watch(b->inotify_fd, "/", IN_CREATE|IN_MOVED_TO); in bus_socket_inotify_setup()
750 if (wd < 0) { in bus_socket_inotify_setup()
754 new_watches[n++] = wd; in bus_socket_inotify_setup()
796wd = inotify_add_watch(b->inotify_fd, prefix, IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB|IN_CREATE|IN_M… in bus_socket_inotify_setup()
797 … log_debug("Added inotify watch for %s on bus %s: %i", prefix, strna(b->description), wd); in bus_socket_inotify_setup()
799 if (wd < 0) { in bus_socket_inotify_setup()
806 new_watches[n++] = wd; in bus_socket_inotify_setup()
/systemd-251/src/timesync/
Dwait-sync.c61 if (e->wd == sp->run_systemd_wd) { in process_inotify_event()
65 } else if (e->wd == sp->run_systemd_timesync_wd) { in process_inotify_event()
/systemd-251/src/libsystemd/sd-journal/
Djournal-internal.h62 int wd; member
Dsd-journal.c1590 if (m->wd > 0) /* Already have a watch? */ in directory_watch()
1595 m->wd = inotify_add_watch_fd(j->inotify_fd, fd, mask); in directory_watch()
1596 if (m->wd < 0) { in directory_watch()
1601 r = hashmap_put(j->directories_by_wd, INT_TO_PTR(m->wd), m); in directory_watch()
1606 (void) inotify_rm_watch(j->inotify_fd, m->wd); in directory_watch()
1607 m->wd = -1; in directory_watch()
1808 if (d->wd > 0) { in remove_directory()
1809 hashmap_remove(j->directories_by_wd, INT_TO_PTR(d->wd)); in remove_directory()
1812 (void) inotify_rm_watch(j->inotify_fd, d->wd); in remove_directory()
2622 d = hashmap_get(j->directories_by_wd, INT_TO_PTR(e->wd)); in process_inotify_event()
/systemd-251/
DTODO189 * sd-event: compat wd reuse in inotify code: keep a set of removed watch
192 see an inotify wd event check against this set, and if it is contained ignore
194 case the same wd is reused multiple times before we start processing