chiark / gitweb /
clients: unify how we invoke getopt_long()
[elogind.git] / src / core / dbus-cgroup.c
index 9ebcad9da6934b4f5999194e93ac2396cb367afb..f198357637579a5fc9820e352d01afd80555f1a0 100644 (file)
@@ -238,7 +238,6 @@ int bus_cgroup_set_property(
                         DBusMessageIter sub2;
                         const char *path;
                         uint64_t u64;
-                        CGroupBlockIODeviceBandwidth *a;
 
                         dbus_message_iter_recurse(&sub, &sub2);
                         if (bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &path, true) < 0 ||
@@ -246,6 +245,7 @@ int bus_cgroup_set_property(
                                 return -EINVAL;
 
                         if (mode != UNIT_CHECK) {
+                                CGroupBlockIODeviceBandwidth *a = NULL;
                                 CGroupBlockIODeviceBandwidth *b;
                                 bool exist = false;
 
@@ -273,8 +273,7 @@ int bus_cgroup_set_property(
                                 a->bandwidth = u64;
 
                                 if (!exist)
-                                        LIST_PREPEND(CGroupBlockIODeviceBandwidth, device_bandwidths,
-                                                     c->blockio_device_bandwidths, a);
+                                        LIST_PREPEND(device_bandwidths, c->blockio_device_bandwidths, a);
                         }
 
                         n++;
@@ -330,7 +329,6 @@ int bus_cgroup_set_property(
                         const char *path;
                         uint64_t u64;
                         unsigned long ul;
-                        CGroupBlockIODeviceWeight *a;
 
                         dbus_message_iter_recurse(&sub, &sub2);
 
@@ -343,6 +341,7 @@ int bus_cgroup_set_property(
                                 return -EINVAL;
 
                         if (mode != UNIT_CHECK) {
+                                CGroupBlockIODeviceWeight *a = NULL;
                                 CGroupBlockIODeviceWeight *b;
                                 bool exist = false;
 
@@ -369,8 +368,7 @@ int bus_cgroup_set_property(
                                 a->weight = ul;
 
                                 if (!exist)
-                                        LIST_PREPEND(CGroupBlockIODeviceWeight, device_weights,
-                                                     c->blockio_device_weights, a);
+                                        LIST_PREPEND(device_weights,c->blockio_device_weights, a);
                         }
 
                         n++;
@@ -467,7 +465,6 @@ int bus_cgroup_set_property(
                 while (dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_STRUCT) {
                         DBusMessageIter sub2;
                         const char *path, *rwm;
-                        CGroupDeviceAllow *a;
 
                         dbus_message_iter_recurse(&sub, &sub2);
 
@@ -489,6 +486,7 @@ int bus_cgroup_set_property(
                         }
 
                         if (mode != UNIT_CHECK) {
+                                CGroupDeviceAllow *a = NULL;
                                 CGroupDeviceAllow *b;
                                 bool exist = false;
 
@@ -517,7 +515,7 @@ int bus_cgroup_set_property(
                                 a->m = !!strchr(rwm, 'm');
 
                                 if (!exist)
-                                        LIST_PREPEND(CGroupDeviceAllow, device_allow, c->device_allow, a);
+                                        LIST_PREPEND(device_allow, c->device_allow, a);
                         }
 
                         n++;