summaryrefslogtreecommitdiff
path: root/cli_args.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-12-10 14:54:06 +0100
committerJakob Unterwurzacher2016-12-10 14:54:06 +0100
commit6af725ff099e78fab2920f060c127415aa3b1893 (patch)
treef376bb15a52b9711e9f7072490e902d441d3df18 /cli_args.go
parente1833fa26a2a42e61aeff6f6e350714133dee378 (diff)
ctlsock: exit early if socket cannot be created; delete on exit
Both are achieved by opening the socket from main and passing it to the ctlsock package instead of passing the path.
Diffstat (limited to 'cli_args.go')
-rw-r--r--cli_args.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cli_args.go b/cli_args.go
index 7301d9a..4d16570 100644
--- a/cli_args.go
+++ b/cli_args.go
@@ -3,6 +3,7 @@ package main
import (
"flag"
"fmt"
+ "net"
"os"
"strconv"
"strings"
@@ -23,9 +24,11 @@ type argContainer struct {
// Configuration file name override
config string
notifypid, scryptn int
+ // Helper variables that are NOT cli options all start with an underscore
// _configCustom is true when the user sets a custom config file name.
- // This is not a CLI option.
_configCustom bool
+ // _ctlsockFd stores the control socket file descriptor (ctlsock stores the path)
+ _ctlsockFd net.Listener
}
var flagSet *flag.FlagSet