aboutsummaryrefslogtreecommitdiffhomepage
path: root/util_windows.go
blob: 51cc3e4e421c05ece9f70ad5799bc59bd4c9af1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package main

// This file contains utility functions for Windows.

import (
	"os/exec"
	"syscall"

	"golang.org/x/sys/windows"
)

// setCommandAsDaemon makes sure this command does not receive signals sent to
// the parent.
func setCommandAsDaemon(daemon *exec.Cmd) {
	daemon.SysProcAttr = &syscall.SysProcAttr{
		CreationFlags: windows.DETACHED_PROCESS,
	}
}