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
=== modified file 'gorun.go'
--- gorun.go 2012-06-10 22:31:19 +0000
+++ gorun.go 2014-01-08 02:10:39 +0000
@@ -262,7 +262,7 @@
262 }262 }
263 infos, err := d.Readdir(-1)263 infos, err := d.Readdir(-1)
264 for _, info := range infos {264 for _, info := range infos {
265 atim := sysStat(info).Atim265 atim := lastAccess(sysStat(info))
266 access := time.Unix(int64(atim.Sec), int64(atim.Nsec))266 access := time.Unix(int64(atim.Sec), int64(atim.Nsec))
267 if access.Before(cleanLine) {267 if access.Before(cleanLine) {
268 os.Remove(filepath.Join(rundir, info.Name()))268 os.Remove(filepath.Join(rundir, info.Name()))
269269
=== added file 'lastaccess_darwin.go'
--- lastaccess_darwin.go 1970-01-01 00:00:00 +0000
+++ lastaccess_darwin.go 2014-01-08 02:10:39 +0000
@@ -0,0 +1,7 @@
1package main
2
3import "syscall"
4
5func lastAccess(s *syscall.Stat_t) *syscall.Timespec {
6 return &s.Atimespec
7}
08
=== added file 'lastaccess_linux.go'
--- lastaccess_linux.go 1970-01-01 00:00:00 +0000
+++ lastaccess_linux.go 2014-01-08 02:10:39 +0000
@@ -0,0 +1,7 @@
1package main
2
3import "syscall"
4
5func lastAccess(s *syscall.Stat_t) *syscall.Timespec {
6 return &s.Atim
7}

Subscribers

People subscribed via source and target branches

to all changes: