aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/sys.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2009-12-04 09:32:50 +0000
committerErlang/OTP <[email protected]>2009-12-04 09:32:50 +0000
commitb1821b0f692deb93b9cae69ca9a1a591f5530474 (patch)
treee48846f9d9734b5bda7088acc23d44623b99030a /lib/stdlib/src/sys.erl
parent5bf73e1dc401a205e02432d3e8ebedde0ad7f117 (diff)
parent88b530ea24977081020feb2123124063e58dfc12 (diff)
downloadotp-b1821b0f692deb93b9cae69ca9a1a591f5530474.tar.gz
otp-b1821b0f692deb93b9cae69ca9a1a591f5530474.tar.bz2
otp-b1821b0f692deb93b9cae69ca9a1a591f5530474.zip
Merge branch 'sv/sys_get_status' into ccase/r13b04_dev
* sv/sys_get_status: Teach sys:get_status/1,2 to call Mod:format_status/2 gen_fsm: Fix format_status/2 to handle Pids OTP-8324 The ability for the gen_server and gen_fsm callback modules to format their own state for display under the sys:get_status/1,2 calls has been restored and documented. (Thanks to Steve Vinoski.)
Diffstat (limited to 'lib/stdlib/src/sys.erl')
-rw-r--r--lib/stdlib/src/sys.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/stdlib/src/sys.erl b/lib/stdlib/src/sys.erl
index e0f2dbcd3c..12209c16d7 100644
--- a/lib/stdlib/src/sys.erl
+++ b/lib/stdlib/src/sys.erl
@@ -245,8 +245,17 @@ do_cmd(SysState, Other, _Parent, _Mod, Debug, Misc) ->
{SysState, {error, {unknown_system_msg, Other}}, Debug, Misc}.
get_status(SysState, Parent, Mod, Debug, Misc) ->
+ PDict = get(),
+ FmtMisc =
+ case erlang:function_exported(Mod, format_status, 2) of
+ true ->
+ FmtArgs = [PDict, SysState, Parent, Debug, Misc],
+ Mod:format_status(normal, FmtArgs);
+ _ ->
+ Misc
+ end,
{status, self(), {module, Mod},
- [get(), SysState, Parent, Debug, Misc]}.
+ [PDict, SysState, Parent, Debug, FmtMisc]}.
%%-----------------------------------------------------------------
%% These are the system debug commands.