libfprint/SOURCES/0094-virtual-image-Only-print-warnings-for-actual-errors.patch
2021-09-09 20:12:48 +00:00

43 lines
1.6 KiB
Diff

From c064261975a12c68d34da8f52ff11942842a4e61 Mon Sep 17 00:00:00 2001
From: Benjamin Berg <bberg@redhat.com>
Date: Wed, 4 Dec 2019 19:55:25 +0100
Subject: [PATCH 094/181] virtual-image: Only print warnings for actual errors
No need to warn for lost connections (if we don't expect more data) or
cancellations.
---
libfprint/drivers/virtual-image.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libfprint/drivers/virtual-image.c b/libfprint/drivers/virtual-image.c
index c271c7a..07a631f 100644
--- a/libfprint/drivers/virtual-image.c
+++ b/libfprint/drivers/virtual-image.c
@@ -75,9 +75,9 @@ recv_image_img_recv_cb (GObject *source_object,
{
if (!success)
{
- g_warning ("Error receiving header for image data: %s", error->message);
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
return;
+ g_warning ("Error receiving header for image data: %s", error->message);
}
self = FPI_DEVICE_VIRTUAL_IMAGE (user_data);
@@ -113,9 +113,10 @@ recv_image_hdr_recv_cb (GObject *source_object,
{
if (!success)
{
- g_warning ("Error receiving header for image data: %s", error->message);
- if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) ||
+ g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED))
return;
+ g_warning ("Error receiving header for image data: %s", error->message);
}
self = FPI_DEVICE_VIRTUAL_IMAGE (user_data);
--
2.24.1