Skip to content

Commit

Permalink
Add OpamProcess.equal and compare
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Oct 29, 2024
1 parent 8e3ee68 commit fabb40f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/opamProcess.ml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ type t = {
p_tmp_files: string list;
}

let equal p1 p2 =
(p1.p_pid : int) = (p2.p_pid : int)

let compare p1 p2 =
Int.compare p1.p_pid p2.p_pid

let output_lines oc lines =
List.iter (fun line ->
output_string oc line;
Expand Down
3 changes: 3 additions & 0 deletions src/core/opamProcess.mli
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ type t = {
completion *)
}

val equal : t -> t -> bool
val compare : t -> t -> int

(** Process results *)
type result = {
r_code : int; (** Process exit code, or 256 on error *)
Expand Down

0 comments on commit fabb40f

Please sign in to comment.