+ /* If the directory's mtime is the same as the wall-clock time
+ * when we stat'ed the directory, we skip updating the mtime in
+ * the database because a message could be delivered later in this
+ * same second. This may lead to unnecessary re-scans, but it
+ * avoids overlooking messages.
+ *
+ * XXX Bug workaround: If this is a new directory, we *must*
+ * update the mtime; otherwise the next run will see the 0 mtime
+ * and think this is still a new directory containing no files or
+ * subdirs (which is unsound in general). If fs_mtime ==
+ * stat_time, we set the database mtime to a bogus (but non-zero!)
+ * value to force a rescan.
+ */
+ if (new_directory && fs_mtime == stat_time)
+ fs_mtime = 1;
+ if (! interrupted && fs_mtime != stat_time) {