X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Finstall.c;h=a9d75f3b7c9e9a3d34ecbace5d4b9c811bf4e7dd;hb=0c0271841ab45595f71528c50bcf1904d4b841d5;hp=c6215fbb32c10db80e6eb8b73ef79550c260093c;hpb=d8831ed55442cfe0a3ca54644282a7c27d26f1b0;p=elogind.git diff --git a/src/shared/install.c b/src/shared/install.c index c6215fbb3..a9d75f3b7 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -59,7 +59,7 @@ static int lookup_paths_init_from_scope(LookupPaths *paths, UnitFileScope scope) zero(*paths); return lookup_paths_init(paths, - scope == UNIT_FILE_SYSTEM ? MANAGER_SYSTEM : MANAGER_USER, + scope == UNIT_FILE_SYSTEM ? SYSTEMD_SYSTEM : SYSTEMD_USER, scope == UNIT_FILE_USER, NULL, NULL, NULL); } @@ -201,7 +201,6 @@ static int remove_marked_symlinks_fd( int r = 0; DIR *d; - struct dirent buffer, *de; assert(remove_symlinks_to); assert(fd >= 0); @@ -218,9 +217,11 @@ static int remove_marked_symlinks_fd( rewinddir(d); for (;;) { + struct dirent *de; + union dirent_storage buf; int k; - k = readdir_r(d, &buffer, &de); + k = readdir_r(d, &buf.de, &de); if (k != 0) { r = -errno; break; @@ -375,7 +376,6 @@ static int find_symlinks_fd( int r = 0; DIR *d; - struct dirent buffer, *de; assert(name); assert(fd >= 0); @@ -391,8 +391,10 @@ static int find_symlinks_fd( for (;;) { int k; + struct dirent *de; + union dirent_storage buf; - k = readdir_r(d, &buffer, &de); + k = readdir_r(d, &buf.de, &de); if (k != 0) { r = -errno; break; @@ -1513,7 +1515,7 @@ int unit_file_enable( /* This will return the number of symlink rules that were supposed to be created, not the ones actually created. This is - useful to determine whether the passed files hat any + useful to determine whether the passed files had any installation data at all. */ r = install_context_apply(&c, &paths, config_path, root_dir, force, changes, n_changes); @@ -1906,7 +1908,6 @@ int unit_file_get_list( return r; STRV_FOREACH(i, paths.unit_path) { - struct dirent buffer, *de; const char *units_dir; free(buf); @@ -1934,9 +1935,11 @@ int unit_file_get_list( } for (;;) { + struct dirent *de; + union dirent_storage buffer; UnitFileList *f; - r = readdir_r(d, &buffer, &de); + r = readdir_r(d, &buffer.de, &de); if (r != 0) { r = -r; goto finish;