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:
1 parent
1513f29495
commit
83fb6d56e1
1 file changed
+4
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user