diff options
author | Lukasz Skalski <l.skalski@samsung.com> | 2014-10-14 16:13:05 +0200 |
---|---|---|
committer | Daniel Mack <daniel@zonque.org> | 2014-10-15 09:09:01 +0200 |
commit | 14759eeb7180902e3e1405b9aec225f063ee213a (patch) | |
tree | feca7c194c5e52ccb9db745b1a5885a50cefa457 /src/bus-proxyd/bus-proxyd.c | |
parent | e9a19bd882ff8a2c8aef5c63b39525ea231e5fb9 (diff) |
bus-proxyd: add missing flag translation for RequestName
Diffstat (limited to 'src/bus-proxyd/bus-proxyd.c')
-rw-r--r-- | src/bus-proxyd/bus-proxyd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c index 1bd7feed7a..6fd722e5e1 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); |