Blame SOURCES/0098-print-Fix-match-error-propagation.patch

73b847
From 4d0f8ba66ba170e6e983ff467b79c66707dbe600 Mon Sep 17 00:00:00 2001
73b847
From: Benjamin Berg <bberg@redhat.com>
73b847
Date: Thu, 5 Dec 2019 10:53:22 +0100
73b847
Subject: [PATCH 098/181] print: Fix match error propagation
73b847
73b847
The FPI_MATCH_ERROR constant was set to 0, however it is propagated to
73b847
the task completion using g_task_propagate_int. As g_task_propagate_int
73b847
will always return -1 on error, we either need to add an explicit -1
73b847
check or we just need to match the semantics.
73b847
73b847
Change the constant to -1, also rearange FP_MATCH_SUCCESS so that it
73b847
does not end up being 0.
73b847
---
73b847
 libfprint/fpi-print.h | 6 +++---
73b847
 1 file changed, 3 insertions(+), 3 deletions(-)
73b847
73b847
diff --git a/libfprint/fpi-print.h b/libfprint/fpi-print.h
73b847
index 94670a0..04500d6 100644
73b847
--- a/libfprint/fpi-print.h
73b847
+++ b/libfprint/fpi-print.h
73b847
@@ -21,13 +21,13 @@ typedef enum {
73b847
 /**
73b847
  * FpiMatchResult:
73b847
  * @FPI_MATCH_ERROR: An error occured during matching
73b847
- * @FPI_MATCH_SUCCESS: The prints matched
73b847
  * @FPI_MATCH_FAIL: The prints did not match
73b847
+ * @FPI_MATCH_SUCCESS: The prints matched
73b847
  */
73b847
 typedef enum {
73b847
-  FPI_MATCH_ERROR = 0,
73b847
-  FPI_MATCH_SUCCESS,
73b847
+  FPI_MATCH_ERROR = -1, /* -1 for g_task_propagate_int */
73b847
   FPI_MATCH_FAIL,
73b847
+  FPI_MATCH_SUCCESS,
73b847
 } FpiMatchResult;
73b847
 
73b847
 void     fpi_print_add_print (FpPrint *print,
73b847
-- 
73b847
2.24.1
73b847