Review feedback.

1. Moves the log message for each socket to the appropriate _unix and
_windows.go
2. Replaces all reference to Abstract Socket for Windows.
3. Adds support for ctrl+c on Windows to exit a shim.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
This commit is contained in:
Justin Terry (VM)
2018-07-27 09:46:15 -07:00
parent 4b5403f9c9
commit af1b6a026e
4 changed files with 24 additions and 15 deletions

View File

@@ -47,7 +47,7 @@ func setupDumpStacks(dump chan<- os.Signal) {
signal.Notify(dump, syscall.SIGUSR1)
}
func serveListener(path string) (net.Listener, string, error) {
func serveListener(path string) (net.Listener, error) {
var (
l net.Listener
err error
@@ -57,14 +57,15 @@ func serveListener(path string) (net.Listener, string, error) {
path = "[inherited from parent]"
} else {
if len(path) > 106 {
return nil, path, errors.Errorf("%q: unix socket path too long (> 106)", path)
return nil, errors.Errorf("%q: unix socket path too long (> 106)", path)
}
l, err = net.Listen("unix", "\x00"+path)
}
if err != nil {
return nil, path, err
return nil, err
}
return l, path, nil
logrus.WithField("socket", path).Debug("serving api on abstract socket")
return l, nil
}
func handleSignals(logger *logrus.Entry, signals chan os.Signal) error {