summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7dfb040)
It's sufficient to check once if something is a regular file, hence,
let's do that.
- dirent_ensure_type(d, de);
-
- if (!dirent_is_file(de))
- continue;
+ if (hidden_file(de->d_name))
+ continue;
- if (fstatat(dirfd(d), de->d_name, &st, 0) < 0) {
+ if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) {
log_warning_errno(errno, "stat() failed on %s/%s: %m", *path, de->d_name);
continue;
}
log_warning_errno(errno, "stat() failed on %s/%s: %m", *path, de->d_name);
continue;
}
if (!name)
return log_oom();
if (!name)
return log_oom();
+ if (hashmap_contains(all_services, name))
+ continue;
+
fpath = strjoin(*path, "/", de->d_name, NULL);
if (!fpath)
return log_oom();
fpath = strjoin(*path, "/", de->d_name, NULL);
if (!fpath)
return log_oom();
- if (hashmap_contains(all_services, name))
- continue;
-
service = new0(SysvStub, 1);
if (!service)
return log_oom();
service = new0(SysvStub, 1);
if (!service)
return log_oom();