From 85a6d162589c24cf3c27081da821a6a2e584f400 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 4 May 2017 18:19:46 -0700 Subject: [PATCH] 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. --- libobs/obs-data.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libobs/obs-data.c b/libobs/obs-data.c index 5f94b3264..efd406a50 100644 --- a/libobs/obs-data.c +++ b/libobs/obs-data.c @@ -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 * being backed up again */ - os_unlink(json_file); os_rename(backup_file.array, json_file); file_data = obs_data_create_from_json_file(json_file);