[systemd-devel] sd-bus: process ret_error from callback

Liam Beguin lvb at xiphos.com
Sun Jun 30 22:07:07 UTC 2019


Hi Lennart, 

> -----Original Message-----
> From: Lennart Poettering <lennart at poettering.net>
> Sent: June 28, 2019 9:15 AM
> To: Liam Beguin <lvb at xiphos.com>
> Cc: systemd-devel at lists.freedesktop.org
> Subject: Re: [systemd-devel] sd-bus: process ret_error from callback
> 
> On Do, 27.06.19 18:50, Liam Beguin (lvb at xiphos.com) wrote:
> 
> > Hi all,
> >
> > I'm trying to process the `sd_bus_error` set in a
> > `sd_bus_message_handler_t` callback in my main loop but I can't seem
> > to be able to do it properly...
> 
> What have you bound that handler to? If you bound it to a method
> vtable entry, then note that the error you return in the bus error is
> automatically sent by to the client as method reply.
> 
> If you have bound it to a signal, then the error is debug logged, and
> the signal binding is turned off. It's not useful beyond debugging to
> return a bus error object from such a signal message handler.

That would explain my problem. I'm binding the handler to a signal:

	r = sd_bus_add_match(bus, NULL,
	"type='signal',sender='com.xiphos.foo',path='/foo',member='packet_received'",
	packet_received_callback, &foo);

I'll find another way of handling that error.
Thanks for taking the time, 

Liam



More information about the systemd-devel mailing list