New upstream version 23.2.1+dfsg1
This commit is contained in:
parent
cdc9a9fc87
commit
b14f9eae6d
1017 changed files with 37232 additions and 11111 deletions
|
|
@ -359,6 +359,7 @@ int config_save(config_t *config)
|
|||
FILE *f;
|
||||
struct dstr str, tmp;
|
||||
size_t i, j;
|
||||
int ret = CONFIG_ERROR;
|
||||
|
||||
if (!config)
|
||||
return CONFIG_ERROR;
|
||||
|
|
@ -405,9 +406,15 @@ int config_save(config_t *config)
|
|||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
fwrite("\xEF\xBB\xBF", 1, 3, f);
|
||||
if (fwrite("\xEF\xBB\xBF", 3, 1, f) != 1)
|
||||
goto cleanup;
|
||||
#endif
|
||||
fwrite(str.array, 1, str.len, f);
|
||||
if (fwrite(str.array, str.len, 1, f) != 1)
|
||||
goto cleanup;
|
||||
|
||||
ret = CONFIG_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
fclose(f);
|
||||
|
||||
pthread_mutex_unlock(&config->mutex);
|
||||
|
|
@ -415,7 +422,7 @@ int config_save(config_t *config)
|
|||
dstr_free(&tmp);
|
||||
dstr_free(&str);
|
||||
|
||||
return CONFIG_SUCCESS;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int config_save_safe(config_t *config, const char *temp_ext,
|
||||
|
|
@ -444,6 +451,8 @@ int config_save_safe(config_t *config, const char *temp_ext,
|
|||
config->file = file;
|
||||
|
||||
if (ret != CONFIG_SUCCESS) {
|
||||
blog(LOG_ERROR, "config_save_safe: failed to "
|
||||
"write to %s", temp_file.array);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue