port-serial: avoid using MM_CORE_ERROR_CANCELLED

This commit is contained in:
Aleksander Morgado
2019-10-11 07:27:59 +00:00
parent fa453a17a5
commit 651bfd62b4
+3 -7
View File
@@ -815,8 +815,7 @@ port_serial_response_wait_cancelled (GCancellable *cancellable,
/* FIXME: This is not completely correct - if the response finally arrives and there's
* some other command waiting for response right now, the other command will
* get the output of the cancelled command. Not sure what to do here. */
error = g_error_new_literal (MM_CORE_ERROR,
MM_CORE_ERROR_CANCELLED,
error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED,
"Waiting for the reply cancelled");
/* Note: may complete last operation and unref the MMPortSerial */
port_serial_got_response (self, NULL, error);
@@ -1566,10 +1565,7 @@ port_serial_reopen_cancel (MMPortSerial *self)
task = self->priv->reopen_task;
self->priv->reopen_task = NULL;
g_task_return_new_error (task,
MM_CORE_ERROR,
MM_CORE_ERROR_CANCELLED,
"Reopen cancelled");
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_CANCELLED, "Reopen cancelled");
g_object_unref (task);
}
@@ -1740,7 +1736,7 @@ mm_port_serial_flash_finish (MMPortSerial *port,
static gboolean
flash_cancel_cb (GTask *task)
{
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, "Flash cancelled");
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_CANCELLED, "Flash cancelled");
g_object_unref (task);
return G_SOURCE_REMOVE;
}