Merged revisions 160551 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 3 Dec 2008 17:01:03 +0000 (17:01 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 3 Dec 2008 17:01:03 +0000 (17:01 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r160551 | tilghman | 2008-12-03 10:58:34 -0600 (Wed, 03 Dec 2008) | 4 lines

  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: https://origsvn.digium.com/svn/asterisk/trunk@160552 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx/pbx_spool.c

index 26d38df..1955b78 100644 (file)
@@ -40,6 +40,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/utils.h"
+#include "asterisk/options.h"
 
 /*
  * pbx_spool is similar in spirit to qcall, but with substantially enhanced functionality...
@@ -432,10 +433,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)) {