Unverified Commit 935f8a53 authored by Marten Seemann's avatar Marten Seemann Committed by GitHub

Merge pull request #13 from libp2p/fix-staticcheck

fix staticcheck
parents 54a6b11d 9365a29d
...@@ -3,13 +3,11 @@ package sockets ...@@ -3,13 +3,11 @@ package sockets
import ( import (
"sync" "sync"
logging "github.com/ipfs/go-log"
manet "github.com/multiformats/go-multiaddr-net" manet "github.com/multiformats/go-multiaddr-net"
) )
var ( var (
mu sync.Mutex mu sync.Mutex
log = logging.Logger("socket-activation")
initFn = func() {} initFn = func() {}
initialized = false initialized = false
listeners = make(map[string][]manet.Listener) listeners = make(map[string][]manet.Listener)
......
...@@ -9,9 +9,12 @@ import ( ...@@ -9,9 +9,12 @@ import (
"syscall" "syscall"
activation "github.com/coreos/go-systemd/v22/activation" activation "github.com/coreos/go-systemd/v22/activation"
logging "github.com/ipfs/go-log"
manet "github.com/multiformats/go-multiaddr-net" manet "github.com/multiformats/go-multiaddr-net"
) )
var log = logging.Logger("socket-activation")
func isListening(file *os.File) (bool, error) { func isListening(file *os.File) (bool, error) {
ret, err := syscall.GetsockoptInt(int(file.Fd()), syscall.SOL_SOCKET, syscall.SO_ACCEPTCONN) ret, err := syscall.GetsockoptInt(int(file.Fd()), syscall.SOL_SOCKET, syscall.SO_ACCEPTCONN)
return ret == 1, err return ret == 1, err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment