mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-02-08 14:00:29 +01:00
Handle idle cancellations properly
This commit is contained in:
parent
923f04c817
commit
c358306679
1 changed files with 6 additions and 0 deletions
|
|
@ -166,6 +166,9 @@ crfpmoc_read_bytes (gint fd, GIOCondition condition, gpointer user_data)
|
|||
int rv;
|
||||
struct crfpmoc_ec_response_get_next_event_v1 buffer = { 0 };
|
||||
|
||||
if (fd != self->fd)
|
||||
return FALSE;
|
||||
|
||||
rv = read (fd, &buffer, sizeof (buffer));
|
||||
|
||||
if (rv == 0)
|
||||
|
|
@ -314,6 +317,9 @@ crfpmoc_cancel (FpDevice *device)
|
|||
fp_dbg ("Cancel");
|
||||
FpiDeviceCrfpMoc *self = FPI_DEVICE_CRFPMOC (device);
|
||||
|
||||
if (self->task_ssm != NULL)
|
||||
fpi_ssm_mark_failed (self->task_ssm, g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Cancelled"));
|
||||
|
||||
crfpmoc_cmd_fp_mode (self, 0, NULL, NULL);
|
||||
|
||||
g_cancellable_cancel (self->interrupt_cancellable);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue