summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-11-29 16:52:06 +0100
committerDaniel Mack <zonque@gmail.com>2013-11-29 22:01:34 +0100
commitc931748d20ba75e062b6198721970c6871bf23da (patch)
treee4ce9b59a24f730f81d604b56f2e019551c4c514
parentfa6ccbf42360cdd794ae3164b76e0cc8f0bd62de (diff)
libsystemd-bus: factor out DBus bits out of sd_bus_get_owner()
Just a preparation for upcoming kdbus support.
-rw-r--r--src/libsystemd-bus/bus-control.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c
index 5f218c17ea..848a485c3f 100644
--- a/src/libsystemd-bus/bus-control.c
+++ b/src/libsystemd-bus/bus-control.c
@@ -260,7 +260,7 @@ _public_ int sd_bus_list_names(sd_bus *bus, char ***l) {
return 0;
}
-_public_ int sd_bus_get_owner(
+static int sd_bus_get_owner_dbus(
sd_bus *bus,
const char *name,
uint64_t mask,
@@ -273,13 +273,6 @@ _public_ int sd_bus_get_owner(
pid_t pid = 0;
int r;
- assert_return(bus, -EINVAL);
- assert_return(name, -EINVAL);
- assert_return(mask <= _SD_BUS_CREDS_MAX, -ENOTSUP);
- assert_return(mask == 0 || creds, -EINVAL);
- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
- assert_return(!bus_pid_changed(bus), -ECHILD);
-
/* Only query the owner if the caller wants to know it or if
* the caller just wants to check whether a name exists */
if (owner || mask == 0) {
@@ -594,6 +587,23 @@ static int add_name_change_match(sd_bus *bus,
return 0;
}
+_public_ int sd_bus_get_owner(
+ sd_bus *bus,
+ const char *name,
+ uint64_t mask,
+ char **owner,
+ sd_bus_creds **creds) {
+
+ assert_return(bus, -EINVAL);
+ assert_return(name, -EINVAL);
+ assert_return(mask <= _SD_BUS_CREDS_MAX, -ENOTSUP);
+ assert_return(mask == 0 || creds, -EINVAL);
+ assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
+ assert_return(!bus_pid_changed(bus), -ECHILD);
+
+ return sd_bus_get_owner_dbus(bus, name, mask, owner, creds);
+}
+
int bus_add_match_internal(
sd_bus *bus,
const char *match,