mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
install: treat non-existent directory as empty
When looking for symlinks, it doesn't make sense to error-out if the directory is missing. The user might delete an empty directory. This check caused test-unit-file to fail when run before installation.
This commit is contained in:
parent
4a271908f1
commit
d5891fdacf
@ -524,8 +524,11 @@ static int find_symlinks(
|
||||
assert(same_name_link);
|
||||
|
||||
fd = open(config_path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW);
|
||||
if (fd < 0)
|
||||
if (fd < 0) {
|
||||
if (errno == ENOENT)
|
||||
return 0;
|
||||
return -errno;
|
||||
}
|
||||
|
||||
/* This takes possession of fd and closes it */
|
||||
return find_symlinks_fd(name, fd, config_path, config_path, same_name_link);
|
||||
|
@ -40,7 +40,7 @@ int main(int argc, char *argv[]) {
|
||||
assert(h);
|
||||
|
||||
r = unit_file_get_list(UNIT_FILE_SYSTEM, NULL, h);
|
||||
log_info("%s", strerror(-r));
|
||||
log_info("unit_file_get_list: %s", strerror(-r));
|
||||
assert(r >= 0);
|
||||
|
||||
HASHMAP_FOREACH(p, h, i)
|
||||
|
Loading…
Reference in New Issue
Block a user