mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-09 04:13:33 +02:00
device: Fail with any non-zero return value on storage print_data_save()
When saving the prints we use g_file_set_contents under the hood and in case return its error code that is a positive value. So in such case we don't fail if we have a write failure at the end of the enrollment. While we could ensure in file storage to always return a negative value, it's always better to ensure that is has to be 0 when we didn't get an error. Add a test checking for this case.
This commit is contained in:
@ -1791,7 +1791,7 @@ enroll_cb (FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||
{
|
||||
int r;
|
||||
r = store.print_data_save (print);
|
||||
if (r < 0)
|
||||
if (r != 0)
|
||||
name = "enroll-failed";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user