Commit 48f1c7a8 authored by schneider's avatar schneider
Browse files

feat(config): Don't write if new string is equal to old string

parent 8fb680c1
...@@ -507,6 +507,11 @@ int epic_config_set_string(const char *key, const char *value_in) ...@@ -507,6 +507,11 @@ int epic_config_set_string(const char *key, const char *value_in)
int fd2 = -1; int fd2 = -1;
ret = epic_config_get_string(key, buf, sizeof(buf)); ret = epic_config_get_string(key, buf, sizeof(buf));
if (ret == 0 && strcmp(buf, value) == 0) {
/* Nothing to do: the values are the same. */
return 0;
}
size_t nread = read_config_offset( size_t nread = read_config_offset(
slot->value_offset, buf, sizeof(buf) slot->value_offset, buf, sizeof(buf)
); );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment