File 0373-Fix-some-unmatched_return-warnings.patch of Package erlang

From e0f6c9f20d62e2c596a7103809d464c4aaa6b769 Mon Sep 17 00:00:00 2001
From: Kostis Sagonas <kostis@it.uu.se>
Date: Mon, 11 Jun 2018 12:04:18 +0200
Subject: [PATCH 1/2] Fix some unmatched_return warnings

---
 lib/common_test/src/ct_release_test.erl  | 10 +++++-----
 lib/common_test/src/ct_util.erl          |  5 ++++-
 lib/common_test/src/cth_log_redirect.erl |  3 ++-
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/lib/common_test/src/ct_release_test.erl b/lib/common_test/src/ct_release_test.erl
index 60d17f43dc..1ccec57bef 100644
--- a/lib/common_test/src/ct_release_test.erl
+++ b/lib/common_test/src/ct_release_test.erl
@@ -554,11 +554,11 @@ target_system(Apps,CreateDir,InstallDir,{FromVsn,_,AllAppsVsns,Path}) ->
 
     %% create start_erl.data, sys.config and start.src
     StartErlData = filename:join([InstallDir, "releases", "start_erl.data"]),
-    write_file(StartErlData, io_lib:fwrite("~s ~s~n", [ErtsVsn, FromVsn])),
+    ok = write_file(StartErlData, io_lib:fwrite("~s ~s~n", [ErtsVsn, FromVsn])),
     SysConfig = filename:join([InstallDir, "releases", FromVsn, "sys.config"]),
-    write_file(SysConfig, "[]."),
+    ok = write_file(SysConfig, "[]."),
     StartSrc = filename:join(ErtsBinDir,"start.src"),
-    write_file(StartSrc,start_script()),
+    ok = write_file(StartSrc,start_script()),
     ok = file:change_mode(StartSrc,8#0755),
 
     %% Make start_erl executable
@@ -620,7 +620,7 @@ upgrade_system(Apps, FromRel, CreateDir, InstallDir, {_,ToVsn,_,_}) ->
 			      [{path,[FromPath]},
 			       {outdir,CreateDir}]]),
     SysConfig = filename:join([CreateDir, "sys.config"]),
-    write_file(SysConfig, "[]."),
+    ok = write_file(SysConfig, "[]."),
 
     ok = systools(make_tar,[RelName,[{erts,code:root_dir()}]]),
 
@@ -858,7 +858,7 @@ subst_file(Src, Dest, Vars, Opts) ->
     {ok, Bin} = file:read_file(Src),
     Conts = unicode:characters_to_list(Bin),
     NConts = subst(Conts, Vars),
-    write_file(Dest, NConts),
+    ok = write_file(Dest, NConts),
     case lists:member(preserve, Opts) of
         true ->
             {ok, FileInfo} = file:read_file_info(Src),
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl
index d8fd401a64..9f489e9bfb 100644
--- a/lib/common_test/src/ct_util.erl
+++ b/lib/common_test/src/ct_util.erl
@@ -192,7 +192,10 @@ do_start(Parent, Mode, LogDir, Verbosity) ->
 	    ok
     end,
 
-    ct_default_gl:start_link(group_leader()),
+    case ct_default_gl:start_link(group_leader()) of
+        {ok, _} -> ok;
+        ignore -> ok
+    end,
 
     {StartTime,TestLogDir} = ct_logs:init(Mode, Verbosity),
 
-- 
2.16.4