lib: Ensure an error is set in ensure_unlinked() if errno != ENOENT

We hit this with:
```
27411 unlink("/boot/efi/EFI/fedora/grub.cfg.new") = -1 EROFS (Read-only file system)
```
from the grub2 code.

https://github.com/projectatomic/rpm-ostree/issues/633

Closes: #694
Approved by: giuseppe
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-02-20 14:36:09 +00:00
1 parent 6b93cb3173
commit c9356a50b8
1 file changed
+4 -1
+4 -1
View File
@@ -309,7 +309,10 @@ ot_gfile_ensure_unlinked (GFile *path,
if (unlink (gs_file_get_path_cached (path)) != 0)
{
if (errno != ENOENT)
return FALSE;
{
glnx_set_error_from_errno (error);
return FALSE;
}
}
return TRUE;
}