From 9462c3584a1c839fd26287cd0393ff5be0d85619 Mon Sep 17 00:00:00 2001 From: xSmurf Date: Mon, 15 Jun 2015 05:16:05 +0000 Subject: [PATCH] Cleanup proxy conn setup in launch routine --- oz-daemon/launch.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/oz-daemon/launch.go b/oz-daemon/launch.go index b2db04c..cab7cd7 100644 --- a/oz-daemon/launch.go +++ b/oz-daemon/launch.go @@ -135,16 +135,18 @@ func (d *daemonState) launch(p *oz.Profile, pwd string, args, env []string, uid, sbox.ready.Add(1) go sbox.logMessages() - go func () { - sbox.ready.Wait() - - if p.Networking.Nettype != "host" && len(p.Networking.Sockets) > 0 { + if p.Networking.Nettype != "host" && len(p.Networking.Sockets) > 0 { + go func() { + sbox.ready.Wait() err := network.ProxySetup(sbox.init.Process.Pid, p.Networking.Sockets, d.log, sbox.ready) if err != nil { log.Warning("Unable to create connection proxy: %+s", err) } - } - + }() + } + + go func () { + sbox.ready.Wait() go sbox.launchProgram(pwd, args, log) }()