core: Don't call unlink() on directory if it already exists
If we fail to make a directory because it exists, we shouldn't call unlink() on it.
This commit is contained in:
parent
1513f29495
commit
83fb6d56e1
|
|
@ -839,8 +839,10 @@ ostree_create_file_from_input (GFile *dest_file,
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
ot_transfer_out_value(out_checksum, &ret_checksum);
|
ot_transfer_out_value(out_checksum, &ret_checksum);
|
||||||
out:
|
out:
|
||||||
if (!ret)
|
if (!ret && !S_ISDIR(mode))
|
||||||
(void) unlink (dest_path);
|
{
|
||||||
|
(void) unlink (dest_path);
|
||||||
|
}
|
||||||
ot_clear_checksum (&ret_checksum);
|
ot_clear_checksum (&ret_checksum);
|
||||||
g_clear_object (&out);
|
g_clear_object (&out);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue