chiark / gitweb /
Prep v221: Update and clean up build system to sync with upstream
[elogind.git] / src / shared / bus-util.c
similarity index 98%
rename from src/libelogind/sd-bus/bus-util.c
rename to src/shared/bus-util.c
index 2e4cd572fe78ca175374a165ac1e6b283f405dd5..d408e70ebc54845ab4b3de2c3875e03d94fb8a19 100644 (file)
@@ -1326,31 +1326,6 @@ int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) {
                         &u->job_path);
 }
 
-int bus_maybe_reply_error(sd_bus_message *m, int r, sd_bus_error *error) {
-        assert(m);
-
-        if (r < 0) {
-                if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL)
-                        sd_bus_reply_method_errno(m, r, error);
-
-        } else if (sd_bus_error_is_set(error)) {
-                if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL)
-                        sd_bus_reply_method_error(m, error);
-        } else
-                return r;
-
-        log_debug("Failed to process message [type=%s sender=%s path=%s interface=%s member=%s signature=%s]: %s",
-                  bus_message_type_to_string(m->header->type),
-                  strna(m->sender),
-                  strna(m->path),
-                  strna(m->interface),
-                  strna(m->member),
-                  strna(m->root_container.signature),
-                  bus_error_message(error, r));
-
-        return 1;
-}
-
 int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignment) {
         const char *eq, *field;
         int r;
@@ -1886,6 +1861,8 @@ int bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path) {
         return set_put_strdup(d->jobs, path);
 }
 
+/// UNNEEDED by elogind
+#if 0
 int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, UnitFileChange **changes, unsigned *n_changes) {
         const char *type, *path, *source;
         int r;
@@ -1915,6 +1892,7 @@ int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, Un
 
         return 0;
 }
+#endif // 0
 
 /**
  * bus_path_encode_unique() - encode unique object path
@@ -2043,6 +2021,8 @@ int bus_path_decode_unique(const char *path, const char *prefix, char **ret_send
         return 1;
 }
 
+/// UNNEEDED by elogind
+#if 0
 bool is_kdbus_wanted(void) {
         _cleanup_free_ char *value = NULL;
 #ifdef ENABLE_KDBUS
@@ -2076,3 +2056,4 @@ bool is_kdbus_available(void) {
 
         return ioctl(fd, KDBUS_CMD_BUS_MAKE, &cmd) >= 0;
 }
+#endif // 0