[systemd-devel] [PATCH] libsystemd-bus: Add return error msg for unicast signals when well-known name is not available

Lukasz Skalski l.skalski at partner.samsung.com
Wed Dec 4 05:44:21 PST 2013


ENXIO, ESRCH and EADDRNOTAVAIL are also returned by ioctl(KDBUS_CMD_MSG_SEND)
when we have unicast signal messages (signals with a DESTINATION field).
---
 src/libsystemd-bus/bus-kernel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index b85a10d..1499830 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -414,7 +414,7 @@ int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m) {
                         /* ENXIO: unique name not known
                          * ESRCH: well-known name not known */
 
-                        if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL)
+                        if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL || m->header->type == SD_BUS_MESSAGE_SIGNAL)
                                 sd_bus_error_setf(&error, SD_BUS_ERROR_SERVICE_UNKNOWN, "Destination %s not known", m->destination);
                         else
                                 return 0;
@@ -423,7 +423,7 @@ int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m) {
 
                         /* EADDRNOTAVAIL: activation is possible, but turned off in request flags */
 
-                        if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL)
+                        if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL || m->header->type == SD_BUS_MESSAGE_SIGNAL)
                                 sd_bus_error_setf(&error, SD_BUS_ERROR_SERVICE_UNKNOWN, "Activation of %s not requested", m->destination);
                         else
                                 return 0;
-- 
1.8.3.2



More information about the systemd-devel mailing list