From e3c57a86f6ede89651e600d168389be4a78c1b33 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Fri, 31 Jul 2015 11:12:52 +0200 Subject: bus-proxy: fix NameAcquired and NameLost to be directed The NameAcquired and NameLost signals are _directed_ signals. Make sure we properly set the destination correctly, and verify it in our proxy-test. --- src/libsystemd/sd-bus/test-bus-proxy.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/libsystemd/sd-bus/test-bus-proxy.c') diff --git a/src/libsystemd/sd-bus/test-bus-proxy.c b/src/libsystemd/sd-bus/test-bus-proxy.c index 369c2f331c..aef768dc18 100644 --- a/src/libsystemd/sd-bus/test-bus-proxy.c +++ b/src/libsystemd/sd-bus/test-bus-proxy.c @@ -53,7 +53,9 @@ static int test_proxy_acquired(sd_bus_message *m, void *userdata, sd_bus_error * static void test_proxy_matched(void) { _cleanup_bus_flush_close_unref_ sd_bus *a = NULL; + _cleanup_free_ char *matchstr = NULL; TestProxyMatch match = {}; + const char *me; int r; /* open bus 'a' */ @@ -70,10 +72,17 @@ static void test_proxy_matched(void) { r = sd_bus_start(a); assert_se(r >= 0); - r = sd_bus_add_match(a, NULL, - "type='signal'," - "member='NameAcquired'", - test_proxy_acquired, &match); + r = sd_bus_get_unique_name(a, &me); + assert_se(r >= 0); + + matchstr = strjoin("type='signal'," + "member='NameAcquired'," + "destination='", + me, + "'", + NULL); + assert_se(matchstr); + r = sd_bus_add_match(a, NULL, matchstr, test_proxy_acquired, &match); assert_se(r >= 0); r = sd_bus_get_unique_name(a, &match.sender); -- cgit v1.2.3-54-g00ecf