From 19d7e20f5cb7786f87e04a334e19415f18af6562 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 10 Sep 2025 12:10:22 -0500 Subject: T7737: use pid for lock ref The session pid as the lock data makes more sense then the original 'user' field. As we will have use for a session field 'user' elsewhere, make the change now. --- src/vyconfd.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/vyconfd.ml b/src/vyconfd.ml index d765ed8..51014c7 100644 --- a/src/vyconfd.ml +++ b/src/vyconfd.ml @@ -29,9 +29,9 @@ let legacy_config_path = ref false (* Global data *) let sessions : (string, Session.session_data) Hashtbl.t = Hashtbl.create 10 -let commit_lock : string option ref = ref None +let commit_lock : int32 option ref = ref None -let conf_mode_lock : string option ref = ref None +let conf_mode_lock : int32 option ref = ref None (* Command line arguments *) let args = [ @@ -94,14 +94,14 @@ let enter_conf_mode req token = let lock = !conf_mode_lock in let session = Hashtbl.find sessions token in match lock with - | Some user -> + | Some pid -> if req.override_exclusive then aux token session else {response_tmpl with status=Configuration_locked; - error=Some (Printf.sprintf "Configuration was locked by %s" user)} + error=Some (Printf.sprintf "Configuration was locked by %ld" pid)} | None -> - if req.exclusive then (conf_mode_lock := Some session.user; aux token session) + if req.exclusive then (conf_mode_lock := Some session.client_pid; aux token session) else aux token session let exit_conf_mode world token = -- cgit v1.2.3