mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
various cleanups to address linter issues
Signed-off-by: Dominik Süß <dominik@suess.wtf>
This commit is contained in:
+5
-5
@@ -37,8 +37,8 @@ func newNotifySocket(context *cli.Context, notifySocketHost string, id string) *
|
||||
return notifySocket
|
||||
}
|
||||
|
||||
func (ns *notifySocket) Close() error {
|
||||
return ns.socket.Close()
|
||||
func (s *notifySocket) Close() error {
|
||||
return s.socket.Close()
|
||||
}
|
||||
|
||||
// If systemd is supporting sd_notify protocol, this function will add support
|
||||
@@ -66,16 +66,16 @@ func (s *notifySocket) setupSocket() error {
|
||||
|
||||
// pid1 must be set only with -d, as it is used to set the new process as the main process
|
||||
// for the service in systemd
|
||||
func (notifySocket *notifySocket) run(pid1 int) {
|
||||
func (s *notifySocket) run(pid1 int) {
|
||||
buf := make([]byte, 512)
|
||||
notifySocketHostAddr := net.UnixAddr{Name: notifySocket.host, Net: "unixgram"}
|
||||
notifySocketHostAddr := net.UnixAddr{Name: s.host, Net: "unixgram"}
|
||||
client, err := net.DialUnix("unixgram", nil, ¬ifySocketHostAddr)
|
||||
if err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
for {
|
||||
r, err := notifySocket.socket.Read(buf)
|
||||
r, err := s.socket.Read(buf)
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user