libobs: Don't call unlink unnecessarily
A file rename will automatically replace the old file if an older file exists, and will do so automatically. Unlinking is unnecessary, and may have a chance of preventing that move operation from being atomic.
This commit is contained in:
parent
08a94072a0
commit
85a6d16258
@ -682,7 +682,6 @@ obs_data_t *obs_data_create_from_json_file_safe(const char *json_file,
|
|||||||
|
|
||||||
/* delete current file if corrupt to prevent it from
|
/* delete current file if corrupt to prevent it from
|
||||||
* being backed up again */
|
* being backed up again */
|
||||||
os_unlink(json_file);
|
|
||||||
os_rename(backup_file.array, json_file);
|
os_rename(backup_file.array, json_file);
|
||||||
|
|
||||||
file_data = obs_data_create_from_json_file(json_file);
|
file_data = obs_data_create_from_json_file(json_file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user