sd-login: always use "indices" as plural of "index"

So far both "indexes" and "indices" was used. Let's clean this up, and
stick to indices, since it appears to be used more frequently.
This commit is contained in:
Lennart Poettering 2014-07-17 01:48:40 +02:00
parent d12b8cad40
commit 634af5665f
4 changed files with 13 additions and 13 deletions

View File

@ -150,7 +150,7 @@ global:
LIBSYSTEMD_216 {
global:
sd_machine_get_ifindexes;
sd_machine_get_ifindices;
} LIBSYSTEMD_214;
m4_ifdef(`ENABLE_KDBUS',

View File

@ -786,7 +786,7 @@ _public_ int sd_machine_get_class(const char *machine, char **class) {
return 0;
}
_public_ int sd_machine_get_ifindexes(const char *machine, int **ifindexes) {
_public_ int sd_machine_get_ifindices(const char *machine, int **ifindices) {
_cleanup_free_ char *netif = NULL;
size_t l, allocated = 0, nr = 0;
char *w, *state;
@ -795,14 +795,14 @@ _public_ int sd_machine_get_ifindexes(const char *machine, int **ifindexes) {
int r;
assert_return(machine_name_is_valid(machine), -EINVAL);
assert_return(ifindexes, -EINVAL);
assert_return(ifindices, -EINVAL);
p = strappenda("/run/systemd/machines/", machine);
r = parse_env_file(p, NEWLINE, "NETIF", &netif, NULL);
if (r < 0)
return r;
if (!netif) {
*ifindexes = NULL;
*ifindices = NULL;
return 0;
}
@ -825,7 +825,7 @@ _public_ int sd_machine_get_ifindexes(const char *machine, int **ifindexes) {
ni[nr++] = ifi;
}
*ifindexes = ni;
*ifindices = ni;
return nr;
}

View File

@ -80,12 +80,12 @@ enum nss_status _nss_mymachines_gethostbyname4_r(
struct gaih_addrtuple *r_tuple, *r_tuple_first = NULL;
_cleanup_bus_message_unref_ sd_bus_message* reply = NULL;
_cleanup_bus_unref_ sd_bus *bus = NULL;
_cleanup_free_ int *ifindexes = NULL;
_cleanup_free_ int *ifindices = NULL;
_cleanup_free_ char *class = NULL;
size_t l, ms, idx;
unsigned i = 0, c = 0;
char *r_name;
int n_ifindexes, r;
int n_ifindices, r;
assert(name);
assert(pat);
@ -101,9 +101,9 @@ enum nss_status _nss_mymachines_gethostbyname4_r(
goto fail;
}
n_ifindexes = sd_machine_get_ifindexes(name, &ifindexes);
if (n_ifindexes < 0) {
r = n_ifindexes;
n_ifindices = sd_machine_get_ifindices(name, &ifindices);
if (n_ifindices < 0) {
r = n_ifindices;
goto fail;
}
@ -182,7 +182,7 @@ enum nss_status _nss_mymachines_gethostbyname4_r(
r_tuple->next = i == c-1 ? NULL : (struct gaih_addrtuple*) ((char*) r_tuple + ALIGN(sizeof(struct gaih_addrtuple)));
r_tuple->name = r_name;
r_tuple->family = family;
r_tuple->scopeid = n_ifindexes == 1 ? ifindexes[0] : 0;
r_tuple->scopeid = n_ifindices == 1 ? ifindices[0] : 0;
memcpy(r_tuple->addr, a, sz);
idx += ALIGN(sizeof(struct gaih_addrtuple));

View File

@ -181,8 +181,8 @@ int sd_seat_can_graphical(const char *seat);
/* Return the class of machine */
int sd_machine_get_class(const char *machine, char **clazz);
/* Return the list if host-side network interface indexes of a machine */
int sd_machine_get_ifindexes(const char *machine, int **ifindexes);
/* Return the list if host-side network interface indices of a machine */
int sd_machine_get_ifindices(const char *machine, int **ifindices);
/* Get all seats, store in *seats. Returns the number of seats. If
* seats is NULL, this only returns the number of seats. */