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 2017-02-18 10:15:39 -05:00 committed by Atomic Bot
parent 6b93cb3173
commit c9356a50b8
1 changed files with 4 additions and 1 deletions

View File

@ -309,7 +309,10 @@ ot_gfile_ensure_unlinked (GFile *path,
if (unlink (gs_file_get_path_cached (path)) != 0) if (unlink (gs_file_get_path_cached (path)) != 0)
{ {
if (errno != ENOENT) if (errno != ENOENT)
return FALSE; {
glnx_set_error_from_errno (error);
return FALSE;
}
} }
return TRUE; return TRUE;
} }