Reset the context descriptor before checking for the monitor being
shared by another mailbox. Technically, it would be set properly
during the next add, but it shouldn't be left incorrect.
if (monitor_resolve (&info, buffy) != RESOLVERES_OK_EXISTING)
return 2;
+ if (!buffy && (MonitorContextDescriptor == info.monitor->descr))
+ MonitorContextDescriptor = -1;
+
if (Context)
{
if (buffy)
inotify_rm_watch(info.monitor->descr, INotifyFd);
dprint (3, (debugfile, "monitor: inotify_rm_watch for '%s' descriptor=%d\n", info.path, info.monitor->descr));
- if (!buffy && (MonitorContextDescriptor == info.monitor->descr))
- MonitorContextDescriptor = -1;
-
monitor_delete (info.monitor);
monitor_check_free ();
return 0;