diff options
author | Peter Andersson <[email protected]> | 2012-08-23 18:26:15 +0200 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2012-08-23 18:26:15 +0200 |
commit | 38456cd45c8677a567e32722dee0d9602a306037 (patch) | |
tree | a551663d2db938586272f0dbf6d2a86bab7f6f56 /lib/common_test/src/ct_util.erl | |
parent | ada34eeaa3e7f034a3c69ccc95e1bcf2226cb7eb (diff) | |
parent | c9b4ce74e68d25b762a22facdbfe8ab1b078815a (diff) | |
download | otp-38456cd45c8677a567e32722dee0d9602a306037.tar.gz otp-38456cd45c8677a567e32722dee0d9602a306037.tar.bz2 otp-38456cd45c8677a567e32722dee0d9602a306037.zip |
Merge remote branch 'origin/peppe/common_test/io_error' into maint
* origin/peppe/common_test/io_error:
Fix IO bug causing CT Hooks to hang at startup
Diffstat (limited to 'lib/common_test/src/ct_util.erl')
-rw-r--r-- | lib/common_test/src/ct_util.erl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl index 95072ebf58..efc85543ac 100644 --- a/lib/common_test/src/ct_util.erl +++ b/lib/common_test/src/ct_util.erl @@ -858,13 +858,17 @@ call(Msg) -> call(Msg, infinity). call(Msg, Timeout) -> - case whereis(ct_util_server) of - undefined -> + case {self(),whereis(ct_util_server)} of + {_,undefined} -> {error,ct_util_server_not_running}; - Pid -> + {Pid,Pid} -> + %% the caller is ct_util_server, which must + %% be a mistake + {error,bad_invocation}; + {Self,Pid} -> MRef = erlang:monitor(process, Pid), Ref = make_ref(), - ct_util_server ! {Msg,{self(),Ref}}, + ct_util_server ! {Msg,{Self,Ref}}, receive {Ref, Result} -> erlang:demonitor(MRef, [flush]), |