From: Lennart Poettering Date: Sun, 10 Nov 2013 22:52:21 +0000 (+0100) Subject: bus: use ENXIO as error condition when trying to exit a container when we are not... X-Git-Tag: v209~1479 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=f959af205add314dbe90f588723eabdc177956ed;hp=d23284faa9a4d78410b939d42d20b6da3e475f87 bus: use ENXIO as error condition when trying to exit a container when we are not in any 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. --- diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 411156a12..1a50226b0 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -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);