aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-03 16:58:34 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-03 16:58:34 +0000
commit82f89b99ec05a18f69c2989ff090f36f05400df4 (patch)
treed819db76a4aa0f9d4d77b1a052d8956c3f12f22b /pbx
parent77c19bced93f9648f794dcac9f1919267d63d6fc (diff)
Don't start scanning the directory until all modules are loaded, because some
required modules (channels, apps, functions) may not yet be in memory yet. Fixes AST-149. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@160551 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r--pbx/pbx_spool.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index 53211917d..ba73e0d44 100644
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -47,6 +47,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/module.h"
#include "asterisk/options.h"
#include "asterisk/utils.h"
+#include "asterisk/options.h"
/*
* pbx_spool is similar in spirit to qcall, but with substantially enhanced functionality...
@@ -446,9 +447,15 @@ static void *scan_thread(void *unused)
char fn[256];
int res;
time_t last = 0, next = 0, now;
+ struct timespec ts = { .tv_sec = 1 };
+
+ while (!ast_fully_booted) {
+ nanosleep(&ts, NULL);
+ }
+
for(;;) {
/* Wait a sec */
- sleep(1);
+ nanosleep(&ts, NULL);
time(&now);
if (!stat(qdir, &st)) {
if ((st.st_mtime != last) || (next && (now > next))) {