Commit bce9212d authored by Shirou WAKAYAMA's avatar Shirou WAKAYAMA

fix build bugs.

parent d21ed2b4
......@@ -19,7 +19,7 @@ func init() {
if err != nil {
return
}
out, err := exec.Command(getcon, "CLK_TCK").Output()
out, err := exec.Command(getconf, "CLK_TCK").Output()
// ignore errors
if err == nil {
i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64)
......
......@@ -165,7 +165,7 @@ func getLSB() (*LSB, error) {
} else if common.PathExists("/usr/bin/lsb_release") {
lsb_release, err := exec.LookPath("/usr/bin/lsb_release")
if err != nil {
return ret, error
return ret, err
}
out, err := exec.Command(lsb_release).Output()
if err != nil {
......
......@@ -18,7 +18,7 @@ func DoSysctrl(mib string) ([]string, error) {
sysctl, err := exec.LookPath("/usr/bin/getconf")
if err != nil {
return
return []string{}, err
}
out, err := exec.Command(sysctl, "-n", mib).Output()
if err != nil {
......
......@@ -17,7 +17,7 @@ func DoSysctrl(mib string) ([]string, error) {
}
sysctl, err := exec.LookPath("/sbin/sysctl")
if err != nil {
return
return []string{}, err
}
out, err := exec.Command(sysctl, "-n", mib).Output()
if err != nil {
......
......@@ -4,7 +4,6 @@ package mem
import (
"encoding/binary"
"fmt"
"strconv"
"strings"
"syscall"
......@@ -36,8 +35,6 @@ func SwapMemory() (*SwapMemoryStat, error) {
return ret, err
}
fmt.Println(swapUsage)
total := strings.Replace(swapUsage[2], "M", "", 1)
used := strings.Replace(swapUsage[5], "M", "", 1)
free := strings.Replace(swapUsage[8], "M", "", 1)
......
......@@ -17,7 +17,7 @@ import (
// lo0 16384 ::1/128 ::1 869107 - 169411755 869107 - 169411755 - -
// lo0 16384 127 127.0.0.1 869107 - 169411755 869107 - 169411755 - -
func IOCounters(pernic bool) ([]IOCountersStat, error) {
netstat, err := exec.LookPath("/usr/bin/netstat")
netstat, err := exec.LookPath("/usr/sbin/netstat")
if err != nil {
return nil, err
}
......
......@@ -66,11 +66,11 @@ func (p *Process) SendSignal(sig syscall.Signal) error {
kill, err := exec.LookPath("kill")
if err != nil {
return
return err
}
cmd := exec.Command(kill, "-s", sigAsStr, strconv.Itoa(int(p.Pid)))
cmd.Stderr = os.Stderr
err := cmd.Run()
err = cmd.Run()
if err != nil {
return 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