path: rename functions

When this was originally added in 9a00f57a5b,
the lookup function was called sd_path_home. But it was generalized a long time
ago.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-09-14 12:45:43 +02:00
parent 1535b52f1a
commit c19c5aa5b3

View File

@@ -101,7 +101,7 @@ static const char* const path_table[_SD_PATH_MAX] = {
[SD_PATH_SYSTEMD_SEARCH_USER_ENVIRONMENT_GENERATOR] = "systemd-search-user-environment-generator",
};
static int list_homes(void) {
static int list_paths(void) {
int r = 0;
for (size_t i = 0; i < ELEMENTSOF(path_table); i++) {
@@ -123,7 +123,7 @@ static int list_homes(void) {
return r;
}
static int print_home(const char *n) {
static int print_path(const char *n) {
int r;
for (size_t i = 0; i < ELEMENTSOF(path_table); i++)
@@ -217,9 +217,9 @@ static int run(int argc, char* argv[]) {
if (argc > optind)
for (int i = optind; i < argc; i++)
RET_GATHER(r, print_home(argv[i]));
RET_GATHER(r, print_path(argv[i]));
else
r = list_homes();
r = list_paths();
return r;
}