diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c index 3ec773d93..0ec5f8b1a 100644 --- a/plugins/imfile/imfile.c +++ b/plugins/imfile/imfile.c @@ -1628,6 +1628,7 @@ filesDisplay(); // TODO: remove after initial unstable release(s) uchar statefile[MAXFNAME]; uchar toDel[MAXFNAME]; int bDoRMState; + int wd; uchar *statefn; DBGPRINTF("imfile: remove listener '%s', wd %d\n", pLstn->pszFileName, ev->wd); @@ -1653,6 +1654,8 @@ filesDisplay(); // TODO: remove after initial unstable release(s) "file \"%s\": %s", toDel, errStr); } } + wd = wdmapLookupListner(pLstn); + wdmapDel(wd); } static void @@ -1738,7 +1741,6 @@ in_processEvent(struct inotify_event *ev) DBGPRINTF("DDDD: imfile: in_processEvent (wd=%d) event Mask='0x%.8X'\n", ev->wd, ev->mask); if (ev->mask & IN_IGNORED) { - wdmapDel(ev->wd); goto done; } else if (ev->mask & IN_MOVED_FROM) { /* Find wd entry and remove it */