Merge lp:~prepin/gorun/gorun into lp:gorun

Proposed by Pavel Repin
Status: Needs review
Proposed branch: lp:~prepin/gorun/gorun
Merge into: lp:gorun
Diff against target: 36 lines (+15/-1)
3 files modified
gorun.go (+1/-1)
lastaccess_darwin.go (+7/-0)
lastaccess_linux.go (+7/-0)
To merge this branch: bzr merge lp:~prepin/gorun/gorun
Reviewer Review Type Date Requested Status
Gustavo Niemeyer Pending
Review via email: mp+200756@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

20. By Pavel Repin

Handle syscall.Stat_t quirks for GOOS: linux and darwin.

Resolves: https://bugs.launchpad.net/gorun/+bug/1176275

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gorun.go'
2--- gorun.go 2012-06-10 22:31:19 +0000
3+++ gorun.go 2014-01-08 02:10:39 +0000
4@@ -262,7 +262,7 @@
5 }
6 infos, err := d.Readdir(-1)
7 for _, info := range infos {
8- atim := sysStat(info).Atim
9+ atim := lastAccess(sysStat(info))
10 access := time.Unix(int64(atim.Sec), int64(atim.Nsec))
11 if access.Before(cleanLine) {
12 os.Remove(filepath.Join(rundir, info.Name()))
13
14=== added file 'lastaccess_darwin.go'
15--- lastaccess_darwin.go 1970-01-01 00:00:00 +0000
16+++ lastaccess_darwin.go 2014-01-08 02:10:39 +0000
17@@ -0,0 +1,7 @@
18+package main
19+
20+import "syscall"
21+
22+func lastAccess(s *syscall.Stat_t) *syscall.Timespec {
23+ return &s.Atimespec
24+}
25
26=== added file 'lastaccess_linux.go'
27--- lastaccess_linux.go 1970-01-01 00:00:00 +0000
28+++ lastaccess_linux.go 2014-01-08 02:10:39 +0000
29@@ -0,0 +1,7 @@
30+package main
31+
32+import "syscall"
33+
34+func lastAccess(s *syscall.Stat_t) *syscall.Timespec {
35+ return &s.Atim
36+}

Subscribers

People subscribed via source and target branches

to all changes: