connection: return ESRCH for unknown names consistently
authorDavid Herrmann <dh.herrmann@gmail.com>
Thu, 10 Apr 2014 18:22:11 +0000 (20:22 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Thu, 10 Apr 2014 18:22:11 +0000 (20:22 +0200)
We use ESRCH for unknown names except in GET_CONN_INFO. That's misleading
and makes error forwarding error prone. Fix that and use ESRCH instead of
ENOENT.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
connection.c
kdbus.h

index 5e7d5537952f8418397d00067bca4769aca30f19..e4d7175a4d9fa15aed5ffb6180e2792c229f10c5 100644 (file)
@@ -1790,7 +1790,7 @@ int kdbus_cmd_conn_info(struct kdbus_conn *conn,
 
                e = kdbus_name_lookup(conn->bus->name_registry, name);
                if (!e) {
-                       ret = -ENOENT;
+                       ret = -ESRCH;
                        goto exit;
                }
 
diff --git a/kdbus.h b/kdbus.h
index f128d3ba27285025815cd5a1b137f194ba6fc5fd..174a1c32367416c0bc4f99d07a53dfefaababcef 100644 (file)
--- a/kdbus.h
+++ b/kdbus.h
@@ -922,8 +922,7 @@ enum kdbus_ioctl_type {
  *                     size.
  * @ENOBUFS:           There is no space left for the submitted data to fit
  *                     into the receiver's pool.
- * @ENOENT:            The name to query information about is currently not on
- *                     the bus.
+ * @ENOENT:            The to be canceled message was not found.
  * @ENOMEM:            Out of memory.
  * @ENOMSG:            The queue is not empty, but no message with a matching
  *                     priority is currently queued.