[systemd-devel] sd_bus_add_match callback

Lennart Poettering lennart at poettering.net
Fri Apr 10 12:13:48 UTC 2020


On Do, 09.04.20 14:12, David J (emacsd at icloud.com) wrote:

> Hello Systemd developers!
>
> > I asked this question earlier but I haven’t gotten any reply so I thought asking again.
>
> > Question regarding sd_bus_add_match (sd-bus.c):
> >
> > Is there any bad consequences to use the same callback for
> > multiple signal match and then using the userdata parameter to
> > distinguish among the different signals? See the sample code below
> > for a reference of what I am trying to do.

No sure why one would do that, but the userdata argument is something
you can use any way you like. Most people stick some context object
pointer in it, but it's entirely fine to place anything else there,
for example an enum that you cast to a pointer.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list