libglnx porting: Port callers of gs_file_unlink to just unlink()
In the second case it's actually less code too. Closes: #312 Approved by: giuseppe
This commit is contained in:
parent
9d39d3af85
commit
e5eb6f3a22
|
|
@ -1255,9 +1255,12 @@ impl_repo_remote_delete (OstreeRepo *self,
|
||||||
|
|
||||||
if (remote->file != NULL)
|
if (remote->file != NULL)
|
||||||
{
|
{
|
||||||
if (!gs_file_unlink (remote->file, cancellable, error))
|
if (unlink (gs_file_get_path_cached (remote->file)) != 0)
|
||||||
|
{
|
||||||
|
glnx_set_error_from_errno (error);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
local_cleanup_keyfile GKeyFile *config = NULL;
|
local_cleanup_keyfile GKeyFile *config = NULL;
|
||||||
|
|
|
||||||
|
|
@ -390,25 +390,12 @@ ot_gfile_ensure_unlinked (GFile *path,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gboolean ret = FALSE;
|
if (unlink (gs_file_get_path_cached (path)) != 0)
|
||||||
GError *temp_error = NULL;
|
|
||||||
|
|
||||||
if (!gs_file_unlink (path, cancellable, &temp_error))
|
|
||||||
{
|
{
|
||||||
if (g_error_matches (temp_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
if (errno != ENOENT)
|
||||||
{
|
return FALSE;
|
||||||
g_clear_error (&temp_error);
|
|
||||||
}
|
}
|
||||||
else
|
return TRUE;
|
||||||
{
|
|
||||||
g_propagate_error (error, temp_error);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = TRUE;
|
|
||||||
out:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue