From a5f4ad507a23634b59e4b89f7d3e825f2967bea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 17 Jun 2020 14:12:38 +0200 Subject: [PATCH] img-capture: Exit with error if the device doesn't support capture --- examples/img-capture.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/img-capture.c b/examples/img-capture.c index 780c5d7..638aa7e 100644 --- a/examples/img-capture.c +++ b/examples/img-capture.c @@ -162,6 +162,13 @@ main (int argc, const char *argv[]) return EXIT_FAILURE; } + if (!fp_device_supports_capture (dev)) + { + g_warning ("Device %s doesn't support capture", + fp_device_get_name (dev)); + return EXIT_FAILURE; + } + capture_data = g_new0 (CaptureData, 1); capture_data->ret_value = EXIT_FAILURE; capture_data->loop = g_main_loop_new (NULL, FALSE);