trivial: Do not log a scary warning for the common case

This commit is contained in:
Richard Hughes 2021-07-30 16:43:08 +01:00
parent 3b919fc38d
commit 4daaabe451
2 changed files with 5 additions and 3 deletions

View File

@ -203,8 +203,10 @@ fu_device_locker_new_full (gpointer device,
if (!self->open_func (device, error)) {
g_autoptr(GError) error_local = NULL;
if (!self->close_func (device, &error_local)) {
g_debug ("ignoring close error on aborted open: %s",
error_local->message);
if (!g_error_matches(error_local, FWUPD_ERROR, FWUPD_ERROR_NOTHING_TO_DO)) {
g_debug("ignoring close error on aborted open: %s",
error_local->message);
}
}
return NULL;
}

View File

@ -237,7 +237,7 @@ fu_device_open_refcount_func (void)
g_assert_no_error (error);
g_assert_true (ret);
ret = fu_device_close (device, &error);
g_assert_error (error, FWUPD_ERROR, FWUPD_ERROR_INTERNAL);
g_assert_error(error, FWUPD_ERROR, FWUPD_ERROR_NOTHING_TO_DO);
g_assert_false (ret);
}