From e84e886d75698ab6af585959fead3fa3c0ca0168 Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Wed, 16 Oct 2013 23:11:40 +0200 Subject: Don't try to add the log_mf_h handler in sasl unless configured to do so. The functions add_error_logger_mf/1 and delete_error_logger_mf/1 in sasl.erl are designed to do nothing if the handler configuration as returned by get_error_logger_mf/0 is 'undefined'. However, that function returns a triple {undefined,undefined,undefined} when the error_logger_mf_* configurations have not been set. This makes SASL always try to add the log_mf_h handler on startup, passing 'undefined' for each of the Dir, MaxB and MaxF parameters. The gen_event callback function log_mf_h:init/1 will then crash with a function_clause error, causing the handler to be silently removed again. This patch fixes the problem by making get_error_logger_mf/0 return the single atom 'undefined' as it is expected to do. --- lib/sasl/src/sasl.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sasl/src/sasl.erl b/lib/sasl/src/sasl.erl index 989f99dc82..fdea6da13e 100644 --- a/lib/sasl/src/sasl.erl +++ b/lib/sasl/src/sasl.erl @@ -82,8 +82,8 @@ get_mf() -> MaxB = get_mf_maxb(), MaxF = get_mf_maxf(), case {Dir, MaxB, MaxF} of - {undefined,undefined,undefined} = R -> - R; + {undefined,undefined,undefined} -> + undefined; {undefined,_,_} -> exit({missing_config, {sasl, error_logger_mf_dir}}); {_,undefined,_} -> -- cgit v1.2.3