From: Russell Bryant Date: Tue, 16 Dec 2008 14:28:10 +0000 (+0000) Subject: Don't try to change working directory if a directory was not configured. X-Git-Tag: 1.4.23-rc3~3^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c6f1387e7387710a09be89a1295fc3265e509369;p=thirdparty%2Fasterisk.git Don't try to change working directory if a directory was not configured. (closes issue #14089) Reported by: caspy git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164605 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 80976a404c..6b6c115e0b 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -481,7 +481,7 @@ static int spawn_mp3(struct mohclass *class) } } /* 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); }