From 6af725ff099e78fab2920f060c127415aa3b1893 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 10 Dec 2016 14:54:06 +0100 Subject: 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. --- cli_args.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cli_args.go') 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 -- cgit v1.2.3