Lines Matching defs:fs
37 #include "fs-util.h"
253 static void service_fd_store_unlink(ServiceFDStore *fs) {
255 if (!fs)
258 if (fs->service) {
259 assert(fs->service->n_fd_store > 0);
260 LIST_REMOVE(fd_store, fs->service->fd_store, fs);
261 fs->service->n_fd_store--;
264 if (fs->event_source) {
265 sd_event_source_set_enabled(fs->event_source, SD_EVENT_OFF);
266 sd_event_source_unref(fs->event_source);
269 free(fs->fdname);
270 safe_close(fs->fd);
271 free(fs);
338 ServiceFDStore *fs = userdata;
341 assert(fs);
344 service_fd_store_unlink(fs);
349 ServiceFDStore *fs;
358 LIST_FOREACH(fd_store, fs, s->fd_store) {
359 r = same_fd(fs->fd, fd);
369 fs = new0(ServiceFDStore, 1);
370 if (!fs)
373 fs->fd = fd;
374 fs->service = s;
375 fs->fdname = strdup(name ?: "stored");
376 if (!fs->fdname) {
377 free(fs);
381 r = sd_event_add_io(UNIT(s)->manager->event, &fs->event_source, fd, 0, on_fd_store_io, fs);
383 free(fs->fdname);
384 free(fs);
388 (void) sd_event_source_set_description(fs->event_source, "service-fd-store");
390 LIST_PREPEND(fd_store, s->fd_store, fs);
1111 ServiceFDStore *fs;
1127 LIST_FOREACH(fd_store, fs, s->fd_store) {
1128 rfds[rn_fds] = fs->fd;
1129 rfd_names[rn_fds] = strdup(strempty(fs->fdname));
2085 ServiceFDStore *fs;
2133 LIST_FOREACH(fd_store, fs, s->fd_store) {
2137 copy = fdset_put_dup(fds, fs->fd);
2141 c = cescape(fs->fdname);