test-runner: Fix not waiting for system_bus_socket
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 1 Jun 2022 21:09:23 +0000 (14:09 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
This makes test-runner wait for system_bus_socket to be available before
continuing otherwise the likes of bluetoothd would likely fail to start.

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
tools/test-runner.c

index 52282d8..4933906 100755 (executable)
@@ -451,13 +451,13 @@ static pid_t start_dbus_daemon(void)
 
                if (!stat("/run/dbus/system_bus_socket", &st)) {
                        printf("Found D-Bus daemon socket\n");
-                       break;
+                       return pid;
                }
 
-               usleep(25 * 1000);
+               sleep(1);
        }
 
-       return pid;
+       return -1;
 }
 
 static const char *daemon_table[] = {