Branch: Tag:

2015-10-06

2015-10-06 15:05:57 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Filesystem.Monitor [FSEvents]: Make sure that check() doesn't terminate early.

As FSEvents only notifies on directories, and we don't have accellerated
monitors in the monitor_queue, we need to ensure that the monitors one
level down are also notified.

Also adds some (dead) placeholder code for handling switching of the
backend in the FSEvents case.

859: Inside #if HAVE_EVENTSTREAM
   int orig_flags = this::flags;       int(0..1) ret = ::check(flags); -  if (ret) return ret; -  +     if(orig_flags & MF_RECURSE) {    // If using FSEvents, we won't receive the name of the file changed,    // so we have to scan for it.
1475:    int was_nonblocking = !!co_id;    set_blocking();    this::backend = backend; - #if HAVE_INOTIFY + #if HAVE_EVENTSTREAM + #if 0 /* FIXME: The following does NOT work properly. */ +  if (eventstream && backend) { +  foreach(monitors; string path; Monitor m) { +  if (m->accellerated) { +  m->accellerated = 0; +  monitor_queue->push(m); +  } +  } +  } + #endif + #elif HAVE_INOTIFY    if (file) {    if (backend) {    file->set_backend(backend);