summaryrefslogtreecommitdiff
path: root/cmd/podman/run.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/run.go')
-rw-r--r--cmd/podman/run.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd/podman/run.go b/cmd/podman/run.go
index 07af4a6a2..d9bc00b78 100644
--- a/cmd/podman/run.go
+++ b/cmd/podman/run.go
@@ -29,6 +29,13 @@ func runCmd(c *cli.Context) error {
if err := validateFlags(c, createFlags); err != nil {
return err
}
+
+ if c.String("cidfile") != "" {
+ if err := libpod.WriteFile("", c.String("cidfile")); err != nil {
+ return errors.Wrapf(err, "unable to write cidfile %s", c.String("cidfile"))
+ }
+ }
+
runtime, err := getRuntime(c)
if err != nil {
return errors.Wrapf(err, "error creating libpod runtime")
@@ -84,8 +91,9 @@ func runCmd(c *cli.Context) error {
logrus.Debug("new container created ", ctr.ID())
if c.String("cidfile") != "" {
- libpod.WriteFile(ctr.ID(), c.String("cidfile"))
- return nil
+ if err := libpod.WriteFile(ctr.ID(), c.String("cidfile")); err != nil {
+ logrus.Error(err)
+ }
}
// Create a bool channel to track that the console socket attach