Skip to content

Commit

Permalink
lock: error message if dont block enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbou committed Mar 27, 2019
1 parent 28c339e commit e13ee06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/opamSystem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,10 @@ let rec flock_update
Unix.(lockf fd F_ULOCK 0);
Unix.lockf fd (unix_lock_op ~dontblock:true flag) 0
with Unix.Unix_error (Unix.EAGAIN,_,_) ->
if dontblock then raise Locked;
if dontblock then
OpamConsole.error_and_exit `Locked
"Another process has locked %s and non blocking mode enabled"
file;
OpamConsole.formatted_msg
"Another process has locked %s, waiting (%s to abort)... "
file (if Sys.win32 then "CTRL+C" else "C-c");
Expand Down

0 comments on commit e13ee06

Please sign in to comment.