pike.git / lib / modules / Filesystem.pmod / Monitor.pmod / basic.pike

version» Context lines:

pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:972: Inside #if undefined(INHIBIT_INOTIFY_MONITOR)
   instance = System.Inotify._Instance();    if (backend) instance->set_backend(backend);    instance->set_event_callback(inotify_event);    if (co_id) {    MON_WERR("Turning on nonblocking mode for Inotify.\n");    instance->set_nonblocking();    }    }       Stdio.Stat st = file_stat (path, 1); +  mixed err;    if (st && st->isdir) {    // Note: We only want to add watchers on directories. File    // notifications will take place on the directory watch    // descriptors. Expansion of the path to cover notifications    // on individual files is handled in the inotify_event    // callback.    -  if (mixed err = catch { +  if (err = catch {    int new_wd = instance->add_watch(path,    System.Inotify.IN_MOVED_FROM |    System.Inotify.IN_UNMOUNT |    System.Inotify.IN_MOVED_TO |    System.Inotify.IN_MASK_ADD |    System.Inotify.IN_MOVE_SELF |    System.Inotify.IN_DELETE |    System.Inotify.IN_MOVE |    System.Inotify.IN_MODIFY |    System.Inotify.IN_ATTRIB |
pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:1014: Inside #if undefined(INHIBIT_INOTIFY_MONITOR)
   // NB: Inotify seems to not notify on preexisting paths,    // so we need to strap it along.    check();    }    }    }) {    master()->handle_error (err);    }    }    -  return; +  if (st && !err) +  return; // Return early if setup was successful, i.e. avoid +  // registering a polling monitor.      #endif /* !INHIBIT_INOTIFY_MONITOR */    MON_WERR("Registering %O for polling.\n", path);    ::register_path(initial);    }       protected void unregister_path(int|void dying)    {    MON_WERR("Unregistering %O...\n", path);    if (wd != -1) {