]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/bus-unit-util.c
tree-wide: use TAKE_PTR() and TAKE_FD() macros
[thirdparty/systemd.git] / src / shared / bus-unit-util.c
index 54b2137c9c00998a41dd8de602cbbe1c2407a646..a9c17d29e2a0a25813539f179f661107a674b254 100644 (file)
@@ -91,8 +91,7 @@ int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) {
                         return bus_log_create_error(r);                 \
                                                                         \
                 return 1;                                               \
-        }                                                               \
-        struct __useless_struct_to_allow_trailing_semicolon__
+        }
 
 #define DEFINE_BUS_APPEND_PARSE(bus_type, parse_func)                   \
         static int bus_append_##parse_func(                             \
@@ -113,8 +112,7 @@ int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) {
                         return bus_log_create_error(r);                 \
                                                                         \
                 return 1;                                               \
-        }                                                               \
-        struct __useless_struct_to_allow_trailing_semicolon__
+        }
 
 DEFINE_BUS_APPEND_PARSE("b", parse_boolean);
 DEFINE_BUS_APPEND_PARSE("i", ioprio_class_from_string);
@@ -462,7 +460,6 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons
                         return bus_append_safe_atou64(m, field, eq);
 
                 return bus_append_parse_size(m, field, eq, 1024);
-
         }
 
         if (streq(field, "CPUQuota")) {
@@ -1808,8 +1805,7 @@ int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) {
         if (r < 0)
                 return r;
 
-        *ret = d;
-        d = NULL;
+        *ret = TAKE_PTR(d);
 
         return 0;
 }