Commits

Stephen Weeks committed 58c73b6

CR

Comments (0)

Files changed (1)

ocaml/omake/server.ml

       match Result.try_with (fun () -> Inotify.add_watch fd "/" Inotify.([S_All])) with
       | Ok _wd ->
         Emacs.Async.send_all "(Omake.Inotify.ok)"
-      (* CR seanmcl for sweeks: The translation from errno labels to
+      (* XCR seanmcl for sweeks: The translation from errno labels to
          a data type has already been done in core_unix.  Should we expose a
          {to,of}-int function so this could be (to_int Unix.ENOSPC) rather
-         than 28? *)
+         than 28?
+
+         sweeks: I added [Unix.Error.of_system_int].  In the meantime, you can convert
+         [28] to a [Unix.error] using [Unix.unix_error].  E.g.:
+
+         | let e =
+         |   try Unix.unix_error 28 "" ""
+         |   with Unix.Unix_error (e, _, _) -> e
+         | ;;
+         |
+         | let () =
+         |   match e with
+         |   | Unix.ENOSPC -> ()
+         |   | _ -> assert false
+         | ;;
+      *)
       | Error (Inotify.Error (_, 28)) (* ENOSPC = 28 *)
       | Error (Unix.Unix_error (Unix.ENOSPC, _, _)) ->
         Log.printf " Inotify has hit the limit of the number of directories it can watch. Try increasing the number via: