Fix races with threads and file descriptors.
[bpt/emacs.git] / src / inotify.c
index 0bbcd44..f4f850b 100644 (file)
@@ -387,7 +387,7 @@ See inotify_rm_watch(2) for more information.
   /* Cleanup if no more files are watched. */
   if (NILP (watch_list))
     {
-      close (inotifyfd);
+      emacs_close (inotifyfd);
       delete_read_fd (inotifyfd);
       inotifyfd = -1;
     }