diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-02-11 19:02:50 +0100 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-02-11 19:02:50 +0100 |
commit | 743364f647e8486d81a96ce8749d818b05668951 (patch) | |
tree | 5ba743262e2cc42c2ae967ed626eb8291e6f62d5 /daemon_windows.go | |
parent | 73cb1a115569455566e7091ce8d98f31e4fdfddf (diff) |
Fixed tabs
Diffstat (limited to 'daemon_windows.go')
-rw-r--r-- | daemon_windows.go | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/daemon_windows.go b/daemon_windows.go index d5ec1e8..527718a 100644 --- a/daemon_windows.go +++ b/daemon_windows.go @@ -1,34 +1,34 @@ -package main
-
-import (
- "os"
-)
-
-/* Daemonizes the process on windows
- *
- * This is done by spawning and releasing a copy with the --foreground flag
- */
-
-func Daemonize() error {
- argv := []string{os.Args[0], "--foreground"}
- argv = append(argv, os.Args[1:]...)
- attr := &os.ProcAttr{
- Dir: ".",
- Env: os.Environ(),
- Files: []*os.File{
- os.Stdin,
- nil,
- nil,
- },
- }
- process, err := os.StartProcess(
- argv[0],
- argv,
- attr,
- )
- if err != nil {
- return err
- }
- process.Release()
- return nil
-}
+package main + +import ( + "os" +) + +/* Daemonizes the process on windows + * + * This is done by spawning and releasing a copy with the --foreground flag + */ + +func Daemonize() error { + argv := []string{os.Args[0], "--foreground"} + argv = append(argv, os.Args[1:]...) + attr := &os.ProcAttr{ + Dir: ".", + Env: os.Environ(), + Files: []*os.File{ + os.Stdin, + nil, + nil, + }, + } + process, err := os.StartProcess( + argv[0], + argv, + attr, + ) + if err != nil { + return err + } + process.Release() + return nil +} |