mirror of
https://github.com/fluencelabs/redis
synced 2025-03-23 11:00:50 +00:00
CONFIG REWRITE: support for dir and slaveof.
This commit is contained in:
parent
2bc31e55ee
commit
d95592b116
12
src/config.c
12
src/config.c
@ -1329,9 +1329,21 @@ void rewriteConfigSaveOption(struct rewriteConfigState *state) {
|
||||
}
|
||||
|
||||
void rewriteConfigDirOption(struct rewriteConfigState *state) {
|
||||
char cwd[1024];
|
||||
|
||||
if (getcwd(cwd,sizeof(cwd)) == NULL) return; /* no rewrite on error. */
|
||||
rewriteConfigStringOption(state,"dir",cwd,NULL);
|
||||
}
|
||||
|
||||
void rewriteConfigSlaveofOption(struct rewriteConfigState *state) {
|
||||
sds line;
|
||||
|
||||
/* If this is a master, we want all the slaveof config options
|
||||
* in the file to be removed. */
|
||||
if (server.masterhost == NULL) return;
|
||||
line = sdscatprintf(sdsempty(),"slaveof %s %d",
|
||||
server.masterhost, server.masterport);
|
||||
rewriteConfigRewriteLine(state,"slaveof",line,1);
|
||||
}
|
||||
|
||||
void rewriteConfigAppendonlyOption(struct rewriteConfigState *state) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user