mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-17 10:42:48 +00:00
Close DFU devices as soon as possible after the transfer has completed
This allows clients like 'dfu-tool watch' to report the status values correctly.
This commit is contained in:
parent
4d4e91da23
commit
999e96bbd4
@ -325,6 +325,15 @@ fu_provider_usb_update (FuProvider *provider,
|
|||||||
NULL,
|
NULL,
|
||||||
error))
|
error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
/* we're done */
|
||||||
|
if (!dfu_device_close (dfu_device, &error_local)) {
|
||||||
|
g_set_error_literal (error,
|
||||||
|
FWUPD_ERROR,
|
||||||
|
FWUPD_ERROR_INTERNAL,
|
||||||
|
error_local->message);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
fu_provider_set_status (provider, FWUPD_STATUS_IDLE);
|
fu_provider_set_status (provider, FWUPD_STATUS_IDLE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -436,6 +445,15 @@ fu_provider_usb_verify (FuProvider *provider,
|
|||||||
if (dfu_firmware == NULL)
|
if (dfu_firmware == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
/* we're done */
|
||||||
|
if (!dfu_device_close (dfu_device, &error_local)) {
|
||||||
|
g_set_error_literal (error,
|
||||||
|
FWUPD_ERROR,
|
||||||
|
FWUPD_ERROR_INTERNAL,
|
||||||
|
error_local->message);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* the device never came back! */
|
/* the device never came back! */
|
||||||
if (!FU_IS_DEVICE (device)) {
|
if (!FU_IS_DEVICE (device)) {
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
|
Loading…
Reference in New Issue
Block a user