chiark / gitweb /
sync with trunk
[disorder] / server / disorderd.c
index 944777a8a94e7047a0a5b0bdd5316d25623d45fe..758907cbd0ac4370fe99ad9e6729191ded725f43 100644 (file)
@@ -264,8 +264,8 @@ int main(int argc, char **argv) {
   if(config->lock) {
     const char *lockfile;
     int lockfd;
-   struct flock lock;
-    
+    struct flock lock;
+
     lockfile = config_get_file("lock");
     if((lockfd = open(lockfile, O_RDWR|O_CREAT, 0600)) < 0)
       fatal(errno, "error opening %s", lockfile);
@@ -289,8 +289,11 @@ int main(int argc, char **argv) {
   /* ignore SIGPIPE */
   signal(SIGPIPE, SIG_IGN);
   /* start a rescan straight away */
-  if(initial_rescan)
-    trackdb_rescan(ev);
+  if(initial_rescan) {
+    trackdb_rescan(0/*ev*/);
+    /* No ev -> the rescan will block.  Since we called reconfigure() already
+     * any clients will also be forced to block. */
+  }
   rescan_after(86400);
   /* periodically tidy up the database */
   dbgc_after(60);