LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0304-tools-Handle-fast-restarts-of-Xref-server.patch of Package erlang (Project home:Ledest:erlang:20)

From 41ea54fd4e6cb54f5dffed3163468dd9bb5e347f Mon Sep 17 00:00:00 2001
From: Hans Bolinder <hasse@erlang.org>
Date: Tue, 8 May 2018 13:42:36 +0200
Subject: [PATCH] tools: Handle fast restarts of Xref server

---
 lib/tools/src/xref.erl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/tools/src/xref.erl b/lib/tools/src/xref.erl
index 32efa36fa2..466ec7d331 100644
--- a/lib/tools/src/xref.erl
+++ b/lib/tools/src/xref.erl
@@ -1,7 +1,7 @@
 %%
 %% %CopyrightBegin%
 %% 
-%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2018. All Rights Reserved.
 %% 
 %% Licensed under the Apache License, Version 2.0 (the "License");
 %% you may not use this file except in compliance with the License.
@@ -182,7 +182,9 @@ split_args(Opts) ->
     end.
 
 stop(Name) ->
-    gen_server:call(Name, stop, infinity).
+    try gen_server:call(Name, stop, infinity)
+    after catch unregister(Name) % ensure the name is gone
+    end.
 
 add_release(Name, Dir) ->
     gen_server:call(Name, {add_release, Dir}, infinity).
-- 
2.16.3