diff options
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/finished_32.go | 16 | ||||
-rw-r--r-- | libpod/finished_64.go | 16 | ||||
-rw-r--r-- | libpod/finished_unsupported.go | 12 | ||||
-rw-r--r-- | libpod/oci.go | 3 |
4 files changed, 2 insertions, 45 deletions
diff --git a/libpod/finished_32.go b/libpod/finished_32.go deleted file mode 100644 index d66974177..000000000 --- a/libpod/finished_32.go +++ /dev/null @@ -1,16 +0,0 @@ -// +build arm 386 - -package libpod - -import ( - "os" - "syscall" - "time" -) - -// Get created time of a file -// Only works on 32-bit OSes -func getFinishedTime(fi os.FileInfo) time.Time { - st := fi.Sys().(*syscall.Stat_t) - return time.Unix(int64(st.Ctim.Sec), int64(st.Ctim.Nsec)) -} diff --git a/libpod/finished_64.go b/libpod/finished_64.go deleted file mode 100644 index 3688afa84..000000000 --- a/libpod/finished_64.go +++ /dev/null @@ -1,16 +0,0 @@ -// +build !arm,!386,linux - -package libpod - -import ( - "os" - "syscall" - "time" -) - -// Get the created time of a file -// Only works on 64-bit OSes -func getFinishedTime(fi os.FileInfo) time.Time { - st := fi.Sys().(*syscall.Stat_t) - return time.Unix(st.Ctim.Sec, st.Ctim.Nsec) -} diff --git a/libpod/finished_unsupported.go b/libpod/finished_unsupported.go deleted file mode 100644 index a893d668c..000000000 --- a/libpod/finished_unsupported.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build darwin,!linux - -package libpod - -import ( - "os" - "time" -) - -func getFinishedTime(fi os.FileInfo) time.Time { - return time.Time{} -} diff --git a/libpod/oci.go b/libpod/oci.go index fcb36241b..612935aed 100644 --- a/libpod/oci.go +++ b/libpod/oci.go @@ -19,6 +19,7 @@ import ( "github.com/opencontainers/selinux/go-selinux" "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" + "github.com/projectatomic/libpod/pkg/ctime" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" kwait "k8s.io/apimachinery/pkg/util/wait" @@ -422,7 +423,7 @@ func (r *OCIRuntime) updateContainerStatus(ctr *Container) error { return nil } - ctr.state.FinishedTime = getFinishedTime(fi) + ctr.state.FinishedTime = ctime.Created(fi) statusCodeStr, err := ioutil.ReadFile(exitFile) if err != nil { return errors.Wrapf(err, "failed to read exit file for container %s", ctr.ID()) |