From 46cba0d45035627532f593a800d815f3a7d71127 Mon Sep 17 00:00:00 2001 From: Solyn Date: Tue, 16 Nov 2021 20:46:14 +0800 Subject: [PATCH] zebra: fix chdir judgment to avoid starting failed in a non-existent directory Signed-off-by: Solyn --- lib/vty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vty.c b/lib/vty.c index b702fa7850..3df623502b 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -2998,7 +2998,7 @@ static void vty_save_cwd(void) * the whole world is coming down around us * Hence not worrying about it too much. */ - if (!chdir(SYSCONFDIR)) { + if (chdir(SYSCONFDIR)) { flog_err_sys(EC_LIB_SYSTEM_CALL, "Failure to chdir to %s, errno: %d", SYSCONFDIR, errno); -- 2.39.5