nih-dbus-tool expects output integer arguments to use non-zero to denote success
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libnih |
New
|
Undecided
|
Unassigned |
Bug Description
If nih-dbus-tool is passed a snippet such as:
<method name="Foo">
<arg name="myint" type="i" direction="out" />
</method>
... the code that nih-dbus-tool generates in proxy mode contains a block like this:
do {
__label__ enomem;
/* Demarshal a int32_t from the message */
if (dbus_message_
}
*myint = myint_local;
enomem: __attribute__ ((unused));
} while (! *myint)
This is correct, but assumes that if *myint is zero, that is an error condition. Whilst that would seem to be the only reasonable approach for the code nih-dbus-tool generates to take, this may not be a reasonable assumption from the client+servers perspective.
A possible solution would be to simply document this behaviour as a limitation of nih-dbus-tool.