summaryrefslogtreecommitdiffhomepage
path: root/main.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-14 20:06:33 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-14 20:06:33 +0200
commit115a2e394631d0bb5b85b7ccee80550655b8b742 (patch)
tree2cdfc427cd87bd5481b6c71ad0ccdb7845c4488e /main.go
parent28c7eb43358df44ab010f6b7ace2849647d9126c (diff)
Use /dev/null as place holder
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index 09ba39e..b13dcbe 100644
--- a/main.go
+++ b/main.go
@@ -191,8 +191,13 @@ func main() {
env = append(env, fmt.Sprintf("%s=1", ENV_WG_PROCESS_FOREGROUND))
files := [3]*os.File{}
if os.Getenv("LOG_LEVEL") != "" && logLevel != LogLevelSilent {
+ files[0], _ = os.Open(os.DevNull)
files[1] = os.Stdout
files[2] = os.Stderr
+ } else {
+ files[0], _ = os.Open(os.DevNull)
+ files[1], _ = os.Open(os.DevNull)
+ files[2], _ = os.Open(os.DevNull)
}
attr := &os.ProcAttr{
Files: []*os.File{