driver: send out signals before replying to {Request,Release}Name
We got the ordering wrong, fix it. However, note that the signals
triggered by Hello are sent out after the reply to the method call.
@@ -827,10 +827,6 @@ static int driver_method_request_name(Peer *peer, CDVar *in_v, uint32_t serial,
c_dvar_write(out_v, "(u)", reply);
- r = driver_send_reply(peer, out_v, serial);
- if (r)
- return error_trace(r);
-
if (change.name) {
r = driver_name_owner_changed(peer->bus,
change.name->name,
@@ -847,6 +843,10 @@ static int driver_method_request_name(Peer *peer, CDVar *in_v, uint32_t serial,
name_change_deinit(&change);
+ r = driver_send_reply(peer, out_v, serial);
+ if (r)
+ return error_trace(r);
+
return 0;
}
@@ -881,10 +881,6 @@ static int driver_method_release_name(Peer *peer, CDVar *in_v, uint32_t serial,
c_dvar_write(out_v, "(u)", reply);
- r = driver_send_reply(peer, out_v, serial);
- if (r)
- return error_trace(r);
-
if (change.name) {
r = driver_name_owner_changed(peer->bus,
change.name->name,
@@ -896,6 +892,10 @@ static int driver_method_release_name(Peer *peer, CDVar *in_v, uint32_t serial,
name_change_deinit(&change);
+ r = driver_send_reply(peer, out_v, serial);
+ if (r)
+ return error_trace(r);
+
return 0;
}
