diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index bebc08a4e8..091a6a5b81 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -512,7 +512,7 @@ static int spawn_mp3(struct mohclass *class) ast_close_fds_above_n(STDERR_FILENO); /* Child */ - if (chdir(class->dir) < 0) { + if (strcasecmp(class->dir, "nodir") && chdir(class->dir) < 0) { ast_log(LOG_WARNING, "chdir() failed: %s\n", strerror(errno)); _exit(1); }