chiark / gitweb /
sd-login: always use "indices" as plural of "index"
authorLennart Poettering <lennart@poettering.net>
Wed, 16 Jul 2014 23:48:40 +0000 (01:48 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 16 Jul 2014 23:48:40 +0000 (01:48 +0200)
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.

src/libsystemd/libsystemd.sym.m4
src/libsystemd/sd-login/sd-login.c
src/nss-mymachines/nss-mymachines.c
src/systemd/sd-login.h

index 48572cc0b3fd8b6a9464f535df22be3807b673ce..1c24cad1052bd223ed0cbb7f281f60faa64de399 100644 (file)
@@ -150,7 +150,7 @@ global:
 
 LIBSYSTEMD_216 {
 global:
-        sd_machine_get_ifindexes;
+        sd_machine_get_ifindices;
 } LIBSYSTEMD_214;
 
 m4_ifdef(`ENABLE_KDBUS',
index 83d644924164325ecaff1a521e1a27c83ea62d3b..38ff944892ca5abcf75c01add375b16759378703 100644 (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;
 }
 
index 5327499957e0a33cf26dc9202db4931a5e9a4f09..eb1d2b450ba076ecfcf5d569525db68a190c32cb 100644 (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));
index b289ad2a593b8398dc11f9cf5d2822747299c275..1eb3be30b53f454a5527fe174e314e942040ed1f 100644 (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. */