]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bus-util: convert bus_log_{parse,create}_error into defines
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 28 Jul 2019 09:43:53 +0000 (11:43 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 29 Jul 2019 13:54:53 +0000 (15:54 +0200)
With SYSTEMD_LOG_LOCATION=1, it is much more useful to see the location
where the call to bus_log_{parse,create}_error() was made, rather then
the one-line body of the helper function. Also, it's our internal code,
so having a one-line non-inline function doesn't make much sense anyway.

src/shared/bus-util.c
src/shared/bus-util.h

index 8e301250bcbb58b3152b09bbc1369c4b40f118af..6af115e7aad8d463430676a2880b332a6dbe973d 100644 (file)
@@ -1480,14 +1480,6 @@ int bus_property_get_ulong(
 }
 #endif
 
-int bus_log_parse_error(int r) {
-        return log_error_errno(r, "Failed to parse bus message: %m");
-}
-
-int bus_log_create_error(int r) {
-        return log_error_errno(r, "Failed to create bus message: %m");
-}
-
 /**
  * bus_path_encode_unique() - encode unique object path
  * @b: bus connection or NULL
index 3216b0c37a1bf0da613923b33ae8973caba3ca1f..1e2f04cc5dffcfc21fdb33bbb9eb8e56d828bc7e 100644 (file)
@@ -114,8 +114,11 @@ assert_cc(sizeof(pid_t) == sizeof(uint32_t));
 assert_cc(sizeof(mode_t) == sizeof(uint32_t));
 #define bus_property_get_mode ((sd_bus_property_get_t) NULL)
 
-int bus_log_parse_error(int r);
-int bus_log_create_error(int r);
+#define bus_log_parse_error(r) \
+        log_error_errno(r, "Failed to parse bus message: %m")
+
+#define bus_log_create_error(r) \
+        log_error_errno(r, "Failed to create bus message: %m")
 
 #define BUS_DEFINE_PROPERTY_GET_GLOBAL(function, bus_type, val)         \
         int function(sd_bus *bus,                                       \