aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/kernel.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2013-04-29 15:28:32 +0200
committerHans Bolinder <[email protected]>2013-05-06 12:14:14 +0200
commitfa6ce2d4653bd7955c8c478a143119dbdd6b9d06 (patch)
tree0bafb8b34d91d7780bf588b614c6e04f784ed88d /lib/kernel/src/kernel.erl
parent19d41eefa1cf4856587930d99959bbed73a818b5 (diff)
downloadotp-fa6ce2d4653bd7955c8c478a143119dbdd6b9d06.tar.gz
otp-fa6ce2d4653bd7955c8c478a143119dbdd6b9d06.tar.bz2
otp-fa6ce2d4653bd7955c8c478a143119dbdd6b9d06.zip
Fix unmatched_returns warning in Kernel
If the file given by the Kernel application variable 'error_logger' cannot be opened a crash will occur.
Diffstat (limited to 'lib/kernel/src/kernel.erl')
-rw-r--r--lib/kernel/src/kernel.erl11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/kernel/src/kernel.erl b/lib/kernel/src/kernel.erl
index 1e07620a3e..ecdb32424a 100644
--- a/lib/kernel/src/kernel.erl
+++ b/lib/kernel/src/kernel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -32,8 +32,13 @@ start(_, []) ->
case supervisor:start_link({local, kernel_sup}, kernel, []) of
{ok, Pid} ->
Type = get_error_logger_type(),
- error_logger:swap_handler(Type),
- {ok, Pid, []};
+ case error_logger:swap_handler(Type) of
+ ok -> {ok, Pid, []};
+ Error ->
+ %% Not necessary since the node will crash anyway:
+ exit(Pid, shutdown),
+ Error
+ end;
Error -> Error
end.