Convert socket group to int
Sockets interface has been updated to take in a the group id as an integer rather than a string. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
4f223337a5
commit
e5d77c64a2
1 changed files with 6 additions and 1 deletions
|
@ -31,7 +31,12 @@ func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) ([]net.Listene
|
|||
}
|
||||
ls = append(ls, l)
|
||||
case "unix":
|
||||
l, err := sockets.NewUnixSocket(addr, socketGroup)
|
||||
|
||||
gid, err := strconv.Atoi(socketGroup)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse socket group id: should be a number: %v", socketGroup)
|
||||
}
|
||||
l, err := sockets.NewUnixSocket(addr, gid)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't create unix socket %s: %v", addr, err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue