Browse Source

Fix panic caused by reading error output unnecessarily. (#94)

kayos 3 years ago
parent
commit
a7fb1237a7
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/mod/disk/diskspace/diskspace.go
  2. 1 1
      src/mod/info/hardwareinfo/sysinfo.go

+ 1 - 1
src/mod/disk/diskspace/diskspace.go

@@ -95,7 +95,7 @@ func GetAllLogicDiskInfo() []LogicalDiskSpaceInfo {
 		//Get drive status using df command
 		cmdin := `df -k | sed -e /Filesystem/d`
 		cmd := exec.Command("bash", "-c", cmdin)
-		dev, err := cmd.CombinedOutput()
+		dev, err := cmd.Output()
 		if err != nil {
 			dev = []byte{}
 		}

+ 1 - 1
src/mod/info/hardwareinfo/sysinfo.go

@@ -39,7 +39,7 @@ func GetDriveStat(w http.ResponseWriter, r *http.Request) {
 	//Get drive status using df command
 	cmdin := `df -k | sed -e /Filesystem/d`
 	cmd := exec.Command("bash", "-c", cmdin)
-	dev, err := cmd.CombinedOutput()
+	dev, err := cmd.Output()
 	if err != nil {
 		dev = []byte{}
 	}