<div dir="ltr">Thanks Lawrence,<div><br></div><div>The problem was 100% attributed to the error not being set to SD_BUS_ERROR_NULL . I also took your advice and made the change to the sd_bus_add_match but I haven't noticed a difference with my unit tests.</div><div><br></div><div>-Jimi</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 3, 2020 at 3:58 PM Lawrence D'Oliveiro <<a href="mailto:ldo@geek-central.gen.nz">ldo@geek-central.gen.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, 3 Oct 2020 08:28:36 -0700, Jimi Damon wrote:<br>
<br>
> /* Callback Function */<br>
> int32_t tcb(sd_bus_message* message, void* userdata, sd_bus_error*<br>
> error)<br>
> {<br>
> <br>
> waiting_control_t* ud = userdata;<br>
> if (ud)<br>
> {<br>
> /* printf("CALLBACK CALLED\n"); */<br>
> ud->found = 1;<br>
> sd_bus_slot_unref(ud->slot);<br>
> }<br>
> <br>
> return EXIT_SUCCESS;<br>
> }<br>
<br>
Just a thought, the man page<br>
<<a href="https://www.freedesktop.org/software/systemd/man/sd_bus_add_match.html" rel="noreferrer" target="_blank">https://www.freedesktop.org/software/systemd/man/sd_bus_add_match.html</a>><br>
says “If [the callback] wants other callbacks that match the same rule<br>
to be called, it should return 0. Otherwise it should return a positive<br>
integer”. Here you are returning 0 (EXIT_SUCCESS). Does it make a<br>
difference if you return a value like 1?<br>
<br>
> The problem I have is that if I call another API function<br>
> (logging_client_set_log_path) AFTER I have called this function, then<br>
> the second API call (which sets a property) ALWAYS fails with a -22<br>
> return code (coming from sd_bus_set_property). However, if I don't<br>
> call this wait_for_signal API call, then my other API function seems<br>
> to always succeed.<br>
<br>
According to this<br>
<<a href="https://www.freedesktop.org/software/systemd/man/sd_bus_call.html" rel="noreferrer" target="_blank">https://www.freedesktop.org/software/systemd/man/sd_bus_call.html</a>><br>
(and also checking /usr/include/asm-generic/errno-base.h), that value is<br>
-EINVAL, and there is a list of possible reasons for such an error. The<br>
fourth one kind of stands out for me: “The input parameter error is<br>
non-NULL but was not set to SD_BUS_ERROR_NULL”. Could that be<br>
applicable?<br>
_______________________________________________<br>
dbus mailing list<br>
<a href="mailto:dbus@lists.freedesktop.org" target="_blank">dbus@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/dbus" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/dbus</a><br>
</blockquote></div>