diff options
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_api.go | 1 | ||||
-rw-r--r-- | libpod/events/events.go | 12 |
2 files changed, 8 insertions, 5 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go index 96435c2ff..2a2381923 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -574,7 +574,6 @@ func (c *Container) WaitWithInterval(waitTimeout time.Duration) (int32, error) { return 0, err } exitCode := c.state.ExitCode - c.newContainerEvent(events.Wait) return exitCode, nil } diff --git a/libpod/events/events.go b/libpod/events/events.go index 7db36653e..074a3ba5b 100644 --- a/libpod/events/events.go +++ b/libpod/events/events.go @@ -6,6 +6,7 @@ import ( "os" "time" + "github.com/containers/storage" "github.com/pkg/errors" ) @@ -104,8 +105,6 @@ const ( Unpause Status = "unpause" // Untag ... Untag Status = "untag" - // Wait ... - Wait Status = "wait" ) // EventFilter for filtering events @@ -122,6 +121,13 @@ func NewEvent(status Status) Event { // Write will record the event to the given path func (e *Event) Write(path string) error { + // We need to lock events file + lock, err := storage.GetLockfile(path + ".lock") + if err != nil { + return err + } + lock.Lock() + defer lock.Unlock() f, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0700) if err != nil { return err @@ -261,8 +267,6 @@ func StringToStatus(name string) (Status, error) { return Unpause, nil case Untag.String(): return Untag, nil - case Wait.String(): - return Wait, nil } return "", errors.Errorf("unknown event status %s", name) } |