Use loaderr label to handle error. (#9111)

So that we can easily see the lines of the config.
Also unified with other error handling.
This commit is contained in:
Binbin 2021-06-20 13:04:12 +08:00 committed by GitHub
parent 6248127c43
commit 89152f8e41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -487,9 +487,9 @@ void loadServerConfigFromString(char *config) {
}
} else if (!strcasecmp(argv[0],"dir") && argc == 2) {
if (chdir(argv[1]) == -1) {
serverLog(LL_WARNING,"Can't chdir to '%s': %s",
argv[1], strerror(errno));
exit(1);
err = sdscatprintf(sdsempty(), "Can't chdir to '%s': %s",
argv[1], strerror(errno));
goto loaderr;
}
} else if (!strcasecmp(argv[0],"logfile") && argc == 2) {
FILE *logfp;