From 89152f8e41d7c78ad9a3523b60813274265f3589 Mon Sep 17 00:00:00 2001 From: Binbin Date: Sun, 20 Jun 2021 13:04:12 +0800 Subject: [PATCH] Use loaderr label to handle error. (#9111) So that we can easily see the lines of the config. Also unified with other error handling. --- src/config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.c b/src/config.c index 4324af3d3..29de26c5b 100644 --- a/src/config.c +++ b/src/config.c @@ -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;