Skip to content

Commit a242084

Browse files
erikmdAltGr
authored andcommitted
fix: Avoid using lsof -Q which is only available from lsof 4.95.0
(Debian 11 (oldstable) and Ubuntu 22.04 LTS both have lsof 4.93.2.) The only drawback we could expect is generating a nonzero exit code, but the current implementation with Unix.open_process_in works as is.
1 parent 6e9cd2b commit a242084

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/server/learnocaml_server.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ let launch () =
718718

719719
let check_running () =
720720
try
721-
let ic = Printf.ksprintf Unix.open_process_in "lsof -Qti tcp:%d -s tcp:LISTEN" !port in
721+
let ic = Printf.ksprintf Unix.open_process_in "lsof -ti tcp:%d -s tcp:LISTEN" !port in
722722
let pid = match input_line ic with
723723
| "" -> None
724724
| s -> int_of_string_opt s

0 commit comments

Comments
 (0)