summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2023-05-15 13:08:15 +0300
committerGitHub <noreply@github.com>2023-05-15 13:08:15 +0300
commita51eb05b1895babb17c37c36b963e2bcbd5496d5 (patch)
tree7be24b09e0a5621a03e9f9ffe9ef27fcb44d8345 /src/config.c
parente26a769d9627ebecb8607375580970a740348956 (diff)
parent986dbf716e0cb904c80bb444635cea3242859cc1 (diff)
downloadredis-7.2.tar.gz
Release Redis 7.2 RC27.2-rc27.2
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/config.c b/src/config.c
index 94fc039e2..6978cc5e7 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1065,7 +1065,7 @@ void rewriteConfigReleaseState(struct rewriteConfigState *state) {
}
/* Create the configuration rewrite state */
-struct rewriteConfigState *rewriteConfigCreateState() {
+struct rewriteConfigState *rewriteConfigCreateState(void) {
struct rewriteConfigState *state = zmalloc(sizeof(*state));
state->option_to_line = dictCreate(&optionToLineDictType);
state->rewritten = dictCreate(&optionSetDictType);
@@ -1221,7 +1221,7 @@ struct rewriteConfigState *rewriteConfigReadOldFile(char *path) {
*
* "line" is either used, or freed, so the caller does not need to free it
* in any way. */
-void rewriteConfigRewriteLine(struct rewriteConfigState *state, const char *option, sds line, int force) {
+int rewriteConfigRewriteLine(struct rewriteConfigState *state, const char *option, sds line, int force) {
sds o = sdsnew(option);
list *l = dictFetchValue(state->option_to_line,o);
@@ -1231,7 +1231,7 @@ void rewriteConfigRewriteLine(struct rewriteConfigState *state, const char *opti
/* Option not used previously, and we are not forced to use it. */
sdsfree(line);
sdsfree(o);
- return;
+ return 0;
}
if (l) {
@@ -1254,6 +1254,7 @@ void rewriteConfigRewriteLine(struct rewriteConfigState *state, const char *opti
rewriteConfigAppendLine(state,line);
}
sdsfree(o);
+ return 1;
}
/* Write the long long 'bytes' value as a string in a way that is parsable
@@ -1642,7 +1643,7 @@ void rewriteConfigRemoveOrphaned(struct rewriteConfigState *state) {
/* This function returns a string representation of all the config options
* marked with DEBUG_CONFIG, which can be used to help with debugging. */
-sds getConfigDebugInfo() {
+sds getConfigDebugInfo(void) {
struct rewriteConfigState *state = rewriteConfigCreateState();
state->force_write = 1; /* Force the output */
state->needs_signature = 0; /* Omit the rewrite signature */
@@ -3259,7 +3260,7 @@ int registerConfigValue(const char *name, const standardConfig *config, int alia
/* Initialize configs to their default values and create and populate the
* runtime configuration dictionary. */
-void initConfigValues() {
+void initConfigValues(void) {
configs = dictCreate(&sdsHashDictType);
dictExpand(configs, sizeof(static_configs) / sizeof(standardConfig));
for (standardConfig *config = static_configs; config->name != NULL; config++) {