From 700c5791f85166db3e8ea1a3b5f93cdfc3abe778 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 11 Oct 2018 17:21:20 +0200 Subject: [PATCH] lib: Async functions cannot be started without a mainloop No mainloop, no async. --- libfprint/fpi-async.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libfprint/fpi-async.c b/libfprint/fpi-async.c index 14a8bbd..9e89e3e 100644 --- a/libfprint/fpi-async.c +++ b/libfprint/fpi-async.c @@ -21,6 +21,7 @@ #include "fp_internal.h" #include "fpi-async.h" +#include "fpi-poll.h" #include #include @@ -162,6 +163,7 @@ API_EXPORTED int fp_async_enroll_start(struct fp_dev *dev, int r; g_return_val_if_fail(dev != NULL, -ENODEV); + g_return_val_if_fail (fpi_poll_is_setup(), -EIO); drv = dev->drv; @@ -270,6 +272,7 @@ API_EXPORTED int fp_async_verify_start(struct fp_dev *dev, int r; g_return_val_if_fail(dev != NULL, -ENODEV); + g_return_val_if_fail (fpi_poll_is_setup(), -EIO); drv = dev->drv; @@ -396,6 +399,7 @@ API_EXPORTED int fp_async_identify_start(struct fp_dev *dev, int r; g_return_val_if_fail(dev != NULL, -ENODEV); + g_return_val_if_fail (fpi_poll_is_setup(), -EIO); drv = dev->drv; @@ -522,6 +526,7 @@ API_EXPORTED int fp_async_capture_start(struct fp_dev *dev, int unconditional, int r; g_return_val_if_fail(dev != NULL, -ENODEV); + g_return_val_if_fail (fpi_poll_is_setup(), -EIO); drv = dev->drv;