summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/containers/start.go2
-rw-r--r--cmd/podman/system/df.go7
2 files changed, 7 insertions, 2 deletions
diff --git a/cmd/podman/containers/start.go b/cmd/podman/containers/start.go
index a7731a0a1..b70e975b7 100644
--- a/cmd/podman/containers/start.go
+++ b/cmd/podman/containers/start.go
@@ -122,7 +122,7 @@ func start(cmd *cobra.Command, args []string) error {
startOptions.Stdout = os.Stdout
}
- var containers []string = args
+ containers := args
if len(filters) > 0 {
for _, f := range filters {
split := strings.SplitN(f, "=", 2)
diff --git a/cmd/podman/system/df.go b/cmd/podman/system/df.go
index b2325507a..49918487a 100644
--- a/cmd/podman/system/df.go
+++ b/cmd/podman/system/df.go
@@ -2,6 +2,7 @@ package system
import (
"fmt"
+ "math"
"os"
"strings"
"time"
@@ -288,6 +289,10 @@ func (d *dfSummary) Size() string {
}
func (d *dfSummary) Reclaimable() string {
- percent := int(float64(d.reclaimable)/float64(d.size)) * 100
+ percent := 0
+ // make sure to check this to prevent div by zero problems
+ if d.size > 0 {
+ percent = int(math.Round(float64(d.reclaimable) / float64(d.size) * float64(100)))
+ }
return fmt.Sprintf("%s (%d%%)", units.HumanSize(float64(d.reclaimable)), percent)
}