From f616bf9f03feb8d9601a4c6ece552e13ec492fb8 Mon Sep 17 00:00:00 2001
From: Anders Svensson <anders@erlang.org>
Date: Mon, 7 Sep 2015 16:57:30 +0200
Subject: Fix watchdog function_clause

Commit 4f365c07 introduced the error on set_watchdog/2, as a consequence
of timeout/1 returning stop, which only happens with accepting
transports with {restrict_connections, false}.
---
 lib/diameter/src/base/diameter_watchdog.erl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'lib')

diff --git a/lib/diameter/src/base/diameter_watchdog.erl b/lib/diameter/src/base/diameter_watchdog.erl
index 3c0d8f6f6e..ea8b2fdb0e 100644
--- a/lib/diameter/src/base/diameter_watchdog.erl
+++ b/lib/diameter/src/base/diameter_watchdog.erl
@@ -541,13 +541,13 @@ set_watchdog(#watchdog{tref = undefined} = S) ->
 
 %% Timer already set: start at new one only at expiry.
 set_watchdog(#watchdog{} = S) ->
-    S#watchdog{tref = diameter_lib:now()};
-
-set_watchdog(stop = No) ->
-    No.
+    S#watchdog{tref = diameter_lib:now()}.
 
 %% set_watchdog/2
 
+set_watchdog(_, stop = No) ->
+    No;
+
 set_watchdog(Ms, #watchdog{tw = TwInit} = S) ->
     S#watchdog{tref = erlang:start_timer(tw(TwInit, Ms), self(), tw)}.
 
-- 
cgit v1.2.3