From: Lennart Poettering Date: Wed, 16 Jul 2014 23:48:40 +0000 (+0200) Subject: sd-login: always use "indices" as plural of "index" X-Git-Tag: v216~542 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=634af5665fda8776d22624d947c8de830e30a874 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. --- diff --git a/src/libsystemd/libsystemd.sym.m4 b/src/libsystemd/libsystemd.sym.m4 index 48572cc0b..1c24cad10 100644 --- a/src/libsystemd/libsystemd.sym.m4 +++ b/src/libsystemd/libsystemd.sym.m4 @@ -150,7 +150,7 @@ global: LIBSYSTEMD_216 { global: - sd_machine_get_ifindexes; + sd_machine_get_ifindices; } LIBSYSTEMD_214; m4_ifdef(`ENABLE_KDBUS', diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c index 83d644924..38ff94489 100644 --- a/src/libsystemd/sd-login/sd-login.c +++ b/src/libsystemd/sd-login/sd-login.c @@ -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; } diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c index 532749995..eb1d2b450 100644 --- a/src/nss-mymachines/nss-mymachines.c +++ b/src/nss-mymachines/nss-mymachines.c @@ -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)); diff --git a/src/systemd/sd-login.h b/src/systemd/sd-login.h index b289ad2a5..1eb3be30b 100644 --- a/src/systemd/sd-login.h +++ b/src/systemd/sd-login.h @@ -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. */