From 52e12459df6a9be708c89f9f34feb7f3ef45f21a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 3 Feb 2020 20:39:44 +0100 Subject: [PATCH] main: Improve comments on fprint manager creation Explain why the manager creation is async better in both in the main file and in the manager itself --- src/main.c | 4 ++-- src/manager.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 2c62c04..a7db66d 100644 --- a/src/main.c +++ b/src/main.c @@ -191,8 +191,8 @@ int main(int argc, char **argv) g_debug("Launching FprintObject"); /* create the one instance of the Manager object to be shared between - * all fprintd users */ - manager = fprint_manager_new(no_timeout); + * all fprintd users. This blocks until all the devices are enumerated */ + manager = fprint_manager_new (no_timeout); /* Obtain the well-known name after the manager has been initialized. * Otherwise a client immediately enumerating the devices will not see diff --git a/src/manager.c b/src/manager.c index ddb166b..021ed44 100644 --- a/src/manager.c +++ b/src/manager.c @@ -174,7 +174,9 @@ fprint_manager_init (FprintManager *manager) manager, G_CONNECT_SWAPPED); - /* Prepare everything by enumerating all devices. */ + /* Prepare everything by enumerating all devices. + * This blocks the main loop until the existing devices are enumerated + */ fp_context_enumerate (priv->context); dbus_g_connection_register_g_object(fprintd_dbus_conn,