mirror of https://github.com/F-Stack/f-stack.git
redis: Fix the bug which parsing arg ERRO.
For using the redis, we should allow users to configure theirs configure file. Now fstack uses the options as below: —-conf config.ini --proc-type= --proc-id= And we should skip 4 args(including program name arg), not 3. Use the redis-config-file: bin/redis-server --conf config.ini \ --proc-type=primary --proc-id=0 redis-3.2.8/redis.conf Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
This commit is contained in:
parent
830124b89c
commit
f7ca998abb
|
@ -3957,17 +3957,17 @@ int main(int argc, char **argv) {
|
||||||
int rc = ff_init(argc, argv);
|
int rc = ff_init(argc, argv);
|
||||||
assert(0 == rc);
|
assert(0 == rc);
|
||||||
ff_mod_init();
|
ff_mod_init();
|
||||||
//split fstack arguments.
|
int new_argc = argc - 4;
|
||||||
int new_argc = argc - 3;
|
|
||||||
if (new_argc <= 0) {
|
if (new_argc <= 0) {
|
||||||
new_argc = 1;
|
new_argc = 1;
|
||||||
}
|
}
|
||||||
char **new_argv = zmalloc(sizeof(char *) * new_argc);
|
|
||||||
|
char **new_argv = zmalloc(sizeof(char *) * new_argc);
|
||||||
new_argv[0] = argv[0];
|
new_argv[0] = argv[0];
|
||||||
int i;
|
int i;
|
||||||
for (i = 1; i < new_argc; i++) {
|
for (i = 1; i < new_argc; i++) {
|
||||||
new_argv[i] = argv[i + 3];
|
new_argv[i] = argv[i + 4];
|
||||||
}
|
}
|
||||||
argv = new_argv;
|
argv = new_argv;
|
||||||
argc = new_argc;
|
argc = new_argc;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue