mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-09 12:58:38 +03:00
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;
|
||||
ot_transfer_out_value(out_checksum, &ret_checksum);
|
||||
out:
|
||||
if (!ret)
|
||||
(void) unlink (dest_path);
|
||||
if (!ret && !S_ISDIR(mode))
|
||||
{
|
||||
(void) unlink (dest_path);
|
||||
}
|
||||
ot_clear_checksum (&ret_checksum);
|
||||
g_clear_object (&out);
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user