Skip to content

Commit

Permalink
Merge pull request #264 from xiaoziv/fix_netstat_compile_bug
Browse files Browse the repository at this point in the history
fix netstat compile bug
  • Loading branch information
kongfei605 authored Nov 22, 2022
2 parents 999b32b + 0d65cc0 commit 63177f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ require (
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.12.0 // indirect
)
require github.com/vmware/govmomi v0.29.0 // indirect

require github.com/vmware/govmomi v0.29.0

replace gopkg.in/yaml.v2 => github.com/rfratto/go-yaml v0.0.0-20211119180816-77389c3526dc

Expand Down
5 changes: 4 additions & 1 deletion inputs/netstat/ext_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ package netstat

import (
"bufio"
"bytes"
"fmt"
"io"
"strconv"
"strings"

"github.com/toolkits/pkg/file"
)

// Copyright 2022 The Prometheus Authors
Expand All @@ -28,7 +31,7 @@ func (p Proc) Netstat() (*ProcNetstat, error) {
filename := p.path("net/netstat")
data, err := file.ReadBytes(filename)
if err != nil {
return ProcNetstat{PID: p.PID}, err
return nil, err
}
procNetstat, err := parseNetstat(bytes.NewReader(data), filename)
procNetstat.PID = p.PID
Expand Down

0 comments on commit 63177f0

Please sign in to comment.