Skip to content

Commit

Permalink
Further refactoring.
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
  • Loading branch information
vishh committed Jun 26, 2014
1 parent ab4201f commit 3e5fe45
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions network/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ func GetStats(networkState *NetworkState) (NetworkStats, error) {
func readSysfsNetworkStats(ethInterface string) (map[string]uint64, error) {
out := make(map[string]uint64)

fullPath, err := filepath.Abs(filepath.Join("/sys/class/net", ethInterface, "statistics/"))
if err != nil {
return out, nil
}
err = filepath.Walk(fullPath, func(path string, _ os.FileInfo, _ error) error {
fullPath := filepath.Join("/sys/class/net", ethInterface, "statistics/")
err := filepath.Walk(fullPath, func(path string, _ os.FileInfo, _ error) error {
// skip fullPath.
if path == fullPath {
return nil
Expand Down

0 comments on commit 3e5fe45

Please sign in to comment.