Browse Source

[stat_cache] FAM: ignore event with no valid match

personal/stbuehler/ci-build
Glenn Strauss 3 years ago
parent
commit
c7eaa502ec
  1. 7
      src/stat_cache.c

7
src/stat_cache.c

@ -160,11 +160,18 @@ static handler_t stat_cache_handle_fdevent(server *srv, void *_fce, int revent)
for (i = 0; i < events; i++) {
FAMEvent fe;
if (FAMNextEvent(&scf->fam, &fe) < 0) break;
/* ignore events which may have been pending for
* paths recently cancelled via FAMCancelMonitor() */
scf->dirs = splaytree_splay(scf->dirs, (int)(intptr_t)fe.userdata);
if (!scf->dirs || scf->dirs->key != (int)(intptr_t)fe.userdata) {
continue;
}
fam_dir_entry *fam_dir = scf->dirs->data;
if (FAMREQUEST_GETREQNUM(&fam_dir->req)
!= FAMREQUEST_GETREQNUM(&fe.fr)) {
continue;
}
if (fe.filename[0] != '/') {
switch(fe.code) {

Loading…
Cancel
Save