[systemd-commits] src/bus-proxyd
Daniel Mack
zonque at kemper.freedesktop.org
Wed Oct 15 00:09:09 PDT 2014
src/bus-proxyd/bus-proxyd.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 14759eeb7180902e3e1405b9aec225f063ee213a
Author: Lukasz Skalski <l.skalski at samsung.com>
Date: Tue Oct 14 16:13:05 2014 +0200
bus-proxyd: add missing flag translation for RequestName
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index 1bd7fee..6fd722e 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -875,7 +875,7 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m) {
} else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "RequestName")) {
const char *name;
- uint32_t flags;
+ uint32_t flags, param;
r = sd_bus_message_read(m, "su", &name, &flags);
if (r < 0)
@@ -886,7 +886,15 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m) {
if ((flags & ~(BUS_NAME_ALLOW_REPLACEMENT|BUS_NAME_REPLACE_EXISTING|BUS_NAME_DO_NOT_QUEUE)) != 0)
return synthetic_reply_method_errno(m, -EINVAL, NULL);
- r = sd_bus_request_name(a, name, flags);
+ param = 0;
+ if (flags & BUS_NAME_ALLOW_REPLACEMENT)
+ param |= SD_BUS_NAME_ALLOW_REPLACEMENT;
+ if (flags & BUS_NAME_REPLACE_EXISTING)
+ param |= SD_BUS_NAME_REPLACE_EXISTING;
+ if (!(flags & BUS_NAME_DO_NOT_QUEUE))
+ param |= SD_BUS_NAME_QUEUE;
+
+ r = sd_bus_request_name(a, name, param);
if (r < 0) {
if (r == -EEXIST)
return synthetic_reply_method_return(m, "u", BUS_NAME_EXISTS);
More information about the systemd-commits
mailing list