Search Linux Wireless

[PATCH 4/9] wmediumd: init time controller connection later

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johannes Berg <johannes.berg@xxxxxxxxx>

Some infrastructure that starts wmediumd might wait for it
to start up by checking the sockets it should offer exist,
yet have time stopped during startup for debug purposes.

Initialize the time connection later so that the startup
can happen regardless of such a scenario. Nothing can be
processed on any of the sockets until we actually get to
the mainloop anyway, so this is entirely safe.

---
 wmediumd/wmediumd.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/wmediumd/wmediumd.c b/wmediumd/wmediumd.c
index 0f45c75be9c9..d7ffd8396d8a 100644
--- a/wmediumd/wmediumd.c
+++ b/wmediumd/wmediumd.c
@@ -1181,18 +1181,6 @@ int main(int argc, char *argv[])
 		usfstl_sched_add_job(&scheduler, &ctx.intf_job);
 	}
 
-	if (time_socket) {
-		usfstl_sched_ctrl_start(&ctrl, time_socket,
-				      1000 /* nsec per usec */,
-				      (uint64_t)-1 /* no ID */,
-				      &scheduler);
-		vusrv.scheduler = &scheduler;
-		vusrv.ctrl = &ctrl;
-		ctx.ctrl = &ctrl;
-	} else {
-		usfstl_sched_wallclock_init(&scheduler, 1000);
-	}
-
 	if (vusrv.socket)
 		usfstl_vhost_user_server_start(&vusrv);
 
@@ -1213,6 +1201,18 @@ int main(int argc, char *argv[])
 	if (api_socket)
 		usfstl_uds_create(api_socket, wmediumd_api_connected, &ctx);
 
+	if (time_socket) {
+		usfstl_sched_ctrl_start(&ctrl, time_socket,
+				      1000 /* nsec per usec */,
+				      (uint64_t)-1 /* no ID */,
+				      &scheduler);
+		vusrv.scheduler = &scheduler;
+		vusrv.ctrl = &ctrl;
+		ctx.ctrl = &ctrl;
+	} else {
+		usfstl_sched_wallclock_init(&scheduler, 1000);
+	}
+
 	while (1) {
 		if (time_socket) {
 			usfstl_sched_next(&scheduler);
-- 
2.26.2




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux