chiark / gitweb /
bus: use ENXIO as error condition when trying to exit a container when we are not...
authorLennart Poettering <lennart@poettering.net>
Sun, 10 Nov 2013 22:52:21 +0000 (23:52 +0100)
committerLennart Poettering <lennart@poettering.net>
Sun, 10 Nov 2013 22:54:55 +0000 (23:54 +0100)
So far we used ENXIO whenever the user tried to read something from a
function that didn't carry the right type, and hence use the same error
here to indicate that what the user expected and what was in the message
didn't match up.

src/libsystemd-bus/bus-message.c

index 411156a12a2b8c75dba2fb232d87798ad9b215ef..1a50226b01292debae278ce0df43598625f3ad2e 100644 (file)
@@ -3018,7 +3018,7 @@ _public_ int sd_bus_message_exit_container(sd_bus_message *m) {
 
         assert_return(m, -EINVAL);
         assert_return(m->sealed, -EPERM);
-        assert_return(m->n_containers > 0, -ENOENT);
+        assert_return(m->n_containers > 0, -ENXIO);
 
         c = message_get_container(m);
         if (c->enclosing == SD_BUS_TYPE_ARRAY) {
@@ -3030,7 +3030,7 @@ _public_ int sd_bus_message_exit_container(sd_bus_message *m) {
 
         } else {
                 if (c->signature && c->signature[c->index] != 0)
-                        return -EINVAL;
+                        return -EBUSY;
         }
 
         free(c->signature);