chiark / gitweb /
Add a config option to suppres rescan on (un)mount.
[disorder] / server / mount.c
index 8a7752ad8b663c1061c0d3277c2c1363d1cb1cfa..8b1c60245e1ef649f540882196f2b74329348ad6 100644 (file)
@@ -41,6 +41,8 @@ static int compare_fsstat(const void *av, const void *bv) {
 #endif
 
 void periodic_mount_check(ev_source *ev_) {
+  if(!config->mount_rescan)
+    return;
 #if HAVE_GETFSSTAT
   /* On OS X, we keep track of the hash of the kernel's mounted
    * filesystem list */
@@ -73,6 +75,7 @@ void periodic_mount_check(ev_source *ev_) {
     trackdb_rescan(ev_, 1/*check*/, 0, 0);
   memcpy(last, current, sizeof last);
   first = 0;
+  gcry_md_close(h);
 #elif defined PATH_MTAB
   /* On Linux we keep track of the modification time of /etc/mtab */
   static time_t last_mount;