Searched defs:de (Results 1 - 25 of 34) sorted by relevance

12

/systemd/src/basic/
H A Ddirent-util.c27 int dirent_ensure_type(DIR *d, struct dirent *de) { argument
31 assert(de);
33 if (de->d_type != DT_UNKNOWN)
36 if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0)
39 de->d_type =
52 bool dirent_is_file(const struct dirent *de) { argument
53 assert(de);
55 if (hidden_file(de->d_name))
58 if (de->d_type != DT_REG &&
59 de
66 dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) argument
[all...]
H A Drm-rf.c76 struct dirent *de; local
81 de = readdir(d);
82 if (!de) {
88 if (streq(de->d_name, ".") || streq(de->d_name, ".."))
91 if (de->d_type == DT_UNKNOWN ||
92 (de->d_type == DT_DIR && (root_dev || (flags & REMOVE_SUBVOLUME)))) {
93 if (fstatat(fd, de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) {
101 is_dir = de->d_type == DT_DIR;
110 subdir_fd = openat(fd, de
[all...]
H A Dstat-util.c76 struct dirent *de; local
82 FOREACH_DIRENT(de, d, return -errno)
H A Dconf-files.c42 struct dirent *de; local
57 FOREACH_DIRENT(de, dir, return -errno) {
60 if (!dirent_is_file_with_suffix(de, suffix))
63 p = strjoin(dirpath, "/", de->d_name, NULL);
H A Dfdset.c145 struct dirent *de; local
164 while ((de = readdir(d))) {
167 if (hidden_file(de->d_name))
170 r = safe_atoi(de->d_name, &fd);
H A Dcopy.c258 struct dirent *de; local
305 FOREACH_DIRENT_ALL(de, d, return -errno) {
309 if (STR_IN_SET(de->d_name, ".", ".."))
312 if (fstatat(dirfd(d), de->d_name, &buf, AT_SYMLINK_NOFOLLOW) < 0) {
321 q = fd_copy_regular(dirfd(d), de->d_name, &buf, fdt, de->d_name);
323 q = fd_copy_directory(dirfd(d), de->d_name, &buf, fdt, de->d_name, original_device, merge);
325 q = fd_copy_symlink(dirfd(d), de->d_name, &buf, fdt, de
[all...]
H A Dfd-util.c201 struct dirent *de; local
229 while ((de = readdir(d))) {
232 if (hidden_file(de->d_name))
235 if (safe_atoi(de->d_name, &fd) < 0)
H A Dfs-util.c479 struct dirent *de; local
482 de = readdir(d);
483 if (!de && errno > 0)
485 if (!de)
488 dirent_ensure_type(d, de);
490 if (!dirent_is_file(de))
498 l[n] = strdup(de->d_name);
H A Dutil.c104 struct dirent *de; local
114 FOREACH_DIRENT(de, d, break) {
119 if (!dirent_is_file(de))
122 if (set_contains(seen, de->d_name)) {
123 log_debug("%1$s/%2$s skipped (%2$s was already seen).", *directory, de->d_name);
127 r = set_put_strdup(seen, de->d_name);
131 path = strjoin(*directory, "/", de->d_name, NULL);
507 struct dirent *de; local
513 de = readdir(d);
514 if (!de
[all...]
/systemd/src/machine/
H A Dmachined.c136 struct dirent *de; local
154 FOREACH_DIRENT(de, d, return -errno) {
158 if (!dirent_is_file(de))
162 if (startswith(de->d_name, "unit:"))
165 if (!machine_name_is_valid(de->d_name))
168 k = manager_add_machine(m, de->d_name, &machine);
170 r = log_error_errno(k, "Failed to add machine by file name %s: %m", de->d_name);
/systemd/src/coredump/
H A Dcoredump-vacuum.c164 struct dirent *de; local
169 FOREACH_DIRENT(de, d, goto fail) {
175 r = uid_from_file_name(de->d_name, &uid);
179 if (fstatat(dirfd(d), de->d_name, &st, AT_NO_AUTOMOUNT|AT_SYMLINK_NOFOLLOW) < 0) {
183 log_warning_errno(errno, "Failed to stat /var/lib/systemd/coredump/%s: %m", de->d_name);
207 n = strdup(de->d_name);
223 n->oldest_file = strdup(de->d_name);
/systemd/src/dbus1-generator/
H A Ddbus1-generator.c217 struct dirent *de; local
232 FOREACH_DIRENT(de, d, goto fail) {
235 if (!endswith(de->d_name, ".service"))
238 q = add_dbus(path, de->d_name, type);
/systemd/src/shared/
H A Dclean-ipc.c205 struct dirent *de; local
210 FOREACH_DIRENT(de, dir, goto fail) {
213 if (STR_IN_SET(de->d_name, "..", "."))
216 if (fstatat(dirfd(dir), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) {
220 log_warning_errno(errno, "Failed to stat() POSIX shared memory segment %s: %m", de->d_name);
231 kid = xopendirat(dirfd(dir), de->d_name, O_NOFOLLOW|O_NOATIME);
234 log_warning_errno(errno, "Failed to enter shared memory directory %s: %m", de->d_name);
243 if (unlinkat(dirfd(dir), de->d_name, AT_REMOVEDIR) < 0) {
248 log_warning_errno(errno, "Failed to remove POSIX shared memory directory %s: %m", de->d_name);
253 if (unlinkat(dirfd(dir), de
287 struct dirent *de; local
[all...]
H A Ddropin.c152 struct dirent *de; local
156 de = readdir(d);
157 if (!de && errno > 0)
160 if (!de)
163 if (hidden_file(de->d_name))
166 f = strjoin(path, "/", de->d_name, NULL);
170 r = consumer(dependency, de->d_name, f, arg);
H A Dmachine-image.c335 struct dirent *de; local
345 FOREACH_DIRENT_ALL(de, d, return -errno) {
348 if (!image_name_is_valid(de->d_name))
351 if (hashmap_contains(h, de->d_name))
354 r = image_make(NULL, dirfd(d), path, de->d_name, &image);
/systemd/src/import/
H A Dpull-common.c56 struct dirent *de; local
79 FOREACH_DIRENT_ALL(de, d, return -errno) {
83 if (de->d_type != DT_UNKNOWN &&
84 de->d_type != dt)
88 a = startswith(de->d_name, prefix);
92 a = de->d_name;
103 b = endswith(de->d_name, suffix);
107 b = strchr(de->d_name, 0);
/systemd/src/journal/
H A Djournal-vacuum.c160 struct dirent *de; local
180 FOREACH_DIRENT_ALL(de, d, r = -errno; goto finish) {
190 if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) {
191 log_debug_errno(errno, "Failed to stat file %s while vacuuming, ignoring: %m", de->d_name);
198 q = strlen(de->d_name);
200 if (endswith(de->d_name, ".journal")) {
210 if (de->d_name[q-8-16-1] != '-' ||
211 de->d_name[q-8-16-1-16-1] != '-' ||
212 de->d_name[q-8-16-1-16-1-32-1] != '@') {
217 p = strdup(de
[all...]
H A Djournald-stream.c650 struct dirent *de; local
661 FOREACH_DIRENT(de, d, goto fail) {
667 if (sscanf(de->d_name, "%lu:%lu", &st_dev, &st_ino) != 2)
674 return log_error_errno(errno, "Failed to stat %s: %m", de->d_name);
684 log_debug("Cannot restore stream file %s", de->d_name);
685 unlinkat(dirfd(d), de->d_name, 0);
691 r = stdout_stream_restore(s, de->d_name, fd);
/systemd/src/login/
H A Dlogind.c286 struct dirent *de; local
303 FOREACH_DIRENT(de, d, return -errno) {
307 if (!dirent_is_file(de))
310 s = hashmap_get(m->seats, de->d_name);
312 unlinkat(dirfd(d), de->d_name, 0);
326 struct dirent *de; local
339 FOREACH_DIRENT(de, d, return -errno) {
342 if (!dirent_is_file(de))
345 k = manager_add_user_by_name(m, de->d_name, NULL);
347 log_notice_errno(k, "Couldn't add lingering user %s: %m", de
357 struct dirent *de; local
400 struct dirent *de; local
447 struct dirent *de; local
[all...]
/systemd/src/test/
H A Dtest-cgroup-util.c181 struct dirent *de; local
187 FOREACH_DIRENT(de, d, break) {
192 if (de->d_type != DT_DIR &&
193 de->d_type != DT_UNKNOWN)
196 r = parse_pid(de->d_name, &pid);
/systemd/src/delta/
H A Ddelta.c324 struct dirent *de; local
329 de = readdir(d);
330 if (!de)
333 dirent_ensure_type(d, de);
335 if (dropins && de->d_type == DT_DIR && endswith(de->d_name, ".d"))
336 enumerate_dir_d(top, bottom, drops, path, de->d_name);
338 if (!dirent_is_file(de))
341 p = strjoin(path, "/", de->d_name, NULL);
/systemd/src/tty-ask-password-agent/
H A Dtty-ask-password-agent.c463 struct dirent *de; local
474 FOREACH_DIRENT_ALL(de, d, return log_error_errno(errno, "Failed to read directory: %m")) {
481 if (de->d_type != DT_REG)
484 if (hidden_file(de->d_name))
487 if (!startswith(de->d_name, "ask."))
490 p = strappend("/run/systemd/ask-password/", de->d_name);
/systemd/src/boot/
H A Dbootctl.c239 struct dirent *de; local
251 FOREACH_DIRENT(de, d, break) {
255 if (!endswith_no_case(de->d_name, ".efi"))
258 if (prefix && !startswith_no_case(de->d_name, prefix))
261 fd = openat(dirfd(d), de->d_name, O_RDONLY|O_CLOEXEC);
263 return log_error_errno(errno, "Failed to open \"%s/%s\" for reading: %m", p, de->d_name);
269 printf(" File: %s/%s/%s (%s)\n", draw_special_char(DRAW_TREE_RIGHT), path, de->d_name, v);
271 printf(" File: %s/%s/%s\n", draw_special_char(DRAW_TREE_RIGHT), path, de->d_name);
594 struct dirent *de; local
613 FOREACH_DIRENT(de,
781 struct dirent *de; local
[all...]
/systemd/src/gpt-auto-generator/
H A Dgpt-auto-generator.c843 struct dirent *de, *found = NULL; local
871 FOREACH_DIRENT_ALL(de, d, return -errno) {
873 if (STR_IN_SET(de->d_name, ".", ".."))
876 if (!IN_SET(de->d_type, DT_LNK, DT_UNKNOWN))
882 found = de;
/systemd/src/sysv-generator/
H A Dsysv-generator.c741 struct dirent *de; local
750 FOREACH_DIRENT(de, d, log_error_errno(errno, "Failed to enumerate directory %s, ignoring: %m", *path)) {
755 if (fstatat(dirfd(d), de->d_name, &st, 0) < 0) {
756 log_warning_errno(errno, "stat() failed on %s/%s, ignoring: %m", *path, de->d_name);
766 name = sysv_translate_name(de->d_name);
782 fpath = strjoin(*path, "/", de->d_name, NULL);
822 struct dirent *de; local
838 FOREACH_DIRENT(de, d, log_error_errno(errno, "Failed to enumerate directory %s, ignoring: %m", path)) {
842 if (de->d_name[0] != 'S' && de
[all...]

Completed in 1382 milliseconds

12