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

version» Context lines:

pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:1024:    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) {    // NB: instance may be null if the main object has been destructed    // and we've been called via a destroy(). -  if (instance) { +  if (instance && dying) {    MON_WERR("### Unregistering from inotify.\n"); -  catch { -  // FIXME: For some reason Inotify often complains -  // when we call rm_watch() with what appears -  // to be correct descriptors (Linux 3.17.2). +  // NB: Inotify automatically removes watches for deleted files, +  // and will complain if we attempt to remove them too. +  // +  // Since we have no idea if there's already a queued ID_IGNORED +  // pending we just throw away any error here. +  mixed err = catch {    instance->rm_watch(wd);    }; -  +  if (err) { +  MON_WERR("### Failed: %s\n", describe_backtrace(err));    } -  +  }    wd = -1;    if (!dying) {    // We now need to be polled...    MON_WERR("Registering for polling.\n");    monitor_queue->push(this);    }    }    ::unregister_path(dying);    }   }
pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:1370:   //! calling @[check()].   //!   //! @seealso   //! @[check()], @[monitor()]   void check_all(mapping(string:int)|void ret_stats)   {    int cnt;    int scanned_cnt;    foreach(monitors; string path; Monitor m) {    scanned_cnt++; +  mixed err = catch {    cnt += check_monitor(m); -  +  }; +  if (err) { +  master()->handle_error(err);    } -  +  }    if (ret_stats) {    ret_stats->num_monitors = sizeof(monitors);    ret_stats->scanned_monitors = scanned_cnt;    ret_stats->updated_monitors = cnt;    ret_stats->idle_time = 0;    }   }      //! Check for changes.   //!