Merge "Do AIDL initialization after daemonizing the process" into udc-dev
diff --git a/hostapd/main.c b/hostapd/main.c
index eb1e861..18b2dd9 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -448,6 +448,13 @@
 		}
 	}
 
+#ifdef CONFIG_CTRL_IFACE_AIDL
+	if (hostapd_aidl_init(ifaces)) {
+		wpa_printf(MSG_ERROR, "Failed to initialize AIDL interface");
+		return -1;
+	}
+#endif /* CONFIG_CTRL_IFACE_AIDL */
+
 	eloop_run();
 
 	return 0;
@@ -898,12 +905,6 @@
 			goto out;
 	}
 
-#ifdef CONFIG_CTRL_IFACE_AIDL
-	if (hostapd_aidl_init(&interfaces)) {
-		wpa_printf(MSG_ERROR, "Failed to initialize AIDL interface");
-		goto out;
-	}
-#endif /* CONFIG_CTRL_IFACE_AIDL */
 	hostapd_global_ctrl_iface_init(&interfaces);
 
 	if (hostapd_global_run(&interfaces, daemonize, pid_file)) {