diff options
author | Sangyoon Jang <s89.jang@samsung.com> | 2014-01-13 17:37:02 +0900 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-02-11 11:55:33 +0100 |
commit | 2b90bf4fe2e0a5bff4d55eb8234386f90155c509 (patch) | |
tree | 3663121d8254f8bb2c921fff7ac2ea9bb1e0fe4b /dbus | |
parent | 84a919c5b56b71b6a3009d6e4a3f952c303d5371 (diff) |
[lib-fix] Fixed return value of kdbus_write_msg
Change-Id: Ia3a45a6a79b40789293603982cee6e3023a2f450
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/dbus-transport-kdbus.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/dbus/dbus-transport-kdbus.c b/dbus/dbus-transport-kdbus.c index 8f201198..67c85f39 100644 --- a/dbus/dbus-transport-kdbus.c +++ b/dbus/dbus-transport-kdbus.c @@ -497,32 +497,26 @@ static int kdbus_write_msg(DBusTransportKdbus *transport, DBusMessage *message, goto again; else if(errno == ENXIO) //no such id on the bus { + ret_size = 0; if(!reply_with_error(DBUS_ERROR_NAME_HAS_NO_OWNER, "Name \"%s\" does not exist", dbus_message_get_destination(message), message, transport->base.connection)) - { - ret_size = -1; goto out; - } } else if((errno == ESRCH) || (errno = EADDRNOTAVAIL)) //when well known name is not available on the bus { + ret_size = 0; if(autostart) { if(!reply_with_error(DBUS_ERROR_SERVICE_UNKNOWN, "The name %s was not provided by any .service files", dbus_message_get_destination(message), message, transport->base.connection)) - { - ret_size = -1; goto out; - } } else if(!reply_with_error(DBUS_ERROR_NAME_HAS_NO_OWNER, "Name \"%s\" does not exist", dbus_message_get_destination(message), message, transport->base.connection)) - { - ret_size = -1; goto out; - } } + else + ret_size = -1; _dbus_verbose("kdbus error sending message: err %d (%m)\n", errno); - ret_size = -1; } out: if(msg) @@ -1400,6 +1394,12 @@ do_writing (DBusTransport *transport) goto out; } } + else if (bytes_written == 0) + { + _dbus_verbose ("Destination is not available\n"); + _dbus_connection_message_sent_unlocked (transport->connection, + message); + } else { _dbus_verbose (" wrote %d bytes of %d\n", bytes_written, |