diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index fd61cb7a83..c90c6fd117 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -941,7 +941,7 @@ static int moh_scan_files(struct mohclass *class) { ast_log(LOG_WARNING, "getcwd() failed: %s\n", strerror(errno)); return -1; } - if (chdir(path) < 0) { + if (chdir(dir_path) < 0) { ast_log(LOG_WARNING, "chdir() failed: %s\n", strerror(errno)); return -1; }