Skip to content

Commit

Permalink
Merge pull request #88 from smira/fix/cloexec
Browse files Browse the repository at this point in the history
fix: add SOCK_CLOEXEC to socket creation
  • Loading branch information
safchain authored Nov 17, 2024
2 parents f8f3ac7 + 4d51994 commit efcb03b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ethtool.go
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ func (e *Ethtool) Close() {

// NewEthtool returns a new ethtool handler
func NewEthtool() (*Ethtool, error) {
fd, err := unix.Socket(unix.AF_INET, unix.SOCK_DGRAM, unix.IPPROTO_IP)
fd, err := unix.Socket(unix.AF_INET, unix.SOCK_DGRAM|unix.SOCK_CLOEXEC, unix.IPPROTO_IP)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit efcb03b

Please sign in to comment.