Commit 3166d415 authored by Shirou WAKAYAMA's avatar Shirou WAKAYAMA

set LC_ALL to C in order to avoid number formatting problem.

parent 79f021f6
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
package common package common
import ( import (
"os"
"os/exec" "os/exec"
"strings" "strings"
"syscall" "syscall"
...@@ -10,6 +11,7 @@ import ( ...@@ -10,6 +11,7 @@ import (
) )
func DoSysctrl(mib string) ([]string, error) { func DoSysctrl(mib string) ([]string, error) {
os.Setenv("LC_ALL", "C")
out, err := exec.Command("/usr/sbin/sysctl", "-n", mib).Output() out, err := exec.Command("/usr/sbin/sysctl", "-n", mib).Output()
if err != nil { if err != nil {
return []string{}, err return []string{}, err
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
package common package common
import ( import (
"os"
"os/exec" "os/exec"
"strings" "strings"
"syscall" "syscall"
...@@ -10,6 +11,7 @@ import ( ...@@ -10,6 +11,7 @@ import (
) )
func DoSysctrl(mib string) ([]string, error) { func DoSysctrl(mib string) ([]string, error) {
os.Setenv("LC_ALL", "C")
out, err := exec.Command("/sbin/sysctl", "-n", mib).Output() out, err := exec.Command("/sbin/sysctl", "-n", mib).Output()
if err != nil { if err != nil {
return []string{}, err return []string{}, 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