print: Fix match error propagation

The FPI_MATCH_ERROR constant was set to 0, however it is propagated to
the task completion using g_task_propagate_int. As g_task_propagate_int
will always return -1 on error, we either need to add an explicit -1
check or we just need to match the semantics.

Change the constant to -1, also rearange FP_MATCH_SUCCESS so that it
does not end up being 0.
This commit is contained in:
Benjamin Berg 2019-12-05 10:53:22 +01:00 committed by Marco Trevisan
parent f404a69b73
commit 6209b22e3b

View file

@ -21,13 +21,13 @@ typedef enum {
/** /**
* FpiMatchResult: * FpiMatchResult:
* @FPI_MATCH_ERROR: An error occured during matching * @FPI_MATCH_ERROR: An error occured during matching
* @FPI_MATCH_SUCCESS: The prints matched
* @FPI_MATCH_FAIL: The prints did not match * @FPI_MATCH_FAIL: The prints did not match
* @FPI_MATCH_SUCCESS: The prints matched
*/ */
typedef enum { typedef enum {
FPI_MATCH_ERROR = 0, FPI_MATCH_ERROR = -1, /* -1 for g_task_propagate_int */
FPI_MATCH_SUCCESS,
FPI_MATCH_FAIL, FPI_MATCH_FAIL,
FPI_MATCH_SUCCESS,
} FpiMatchResult; } FpiMatchResult;
void fpi_print_add_print (FpPrint *print, void fpi_print_add_print (FpPrint *print,