diff --git a/src/frontend/ocamlmerlin/ocamlmerlin.c b/src/frontend/ocamlmerlin/ocamlmerlin.c index 3de5432c40..d9255352df 100644 --- a/src/frontend/ocamlmerlin/ocamlmerlin.c +++ b/src/frontend/ocamlmerlin/ocamlmerlin.c @@ -546,6 +546,13 @@ static void compute_socketname(char socketname[PATHSZ], struct stat *st) snprintf(socketname, PATHSZ, "\\\\.\\pipe\\%s", eventname); #else + const char *merlin_socket = getenv("MERLIN_SOCKET"); + if (merlin_socket != NULL) + { + strcpy(socket_path, merlin_socket); + return; + } + snprintf(socketname, PATHSZ, "ocamlmerlin_%llu_%llu_%llu.socket", (unsigned long long)getuid(),