Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1646)

Delta Between Two Patch Sets: src/pkg/os/stat_solaris.go

Issue 36020043: code review 36020043: os, os/exec, os/user: add support for GOOS=solaris
Left Patch Set: diff -r 6835745cc243 https://code.google.com/p/go Created 10 years, 3 months ago
Right Patch Set: diff -r 884801fb67af https://code.google.com/p/go Created 10 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/os/signal/signal_unix.go ('k') | src/pkg/os/sys_solaris.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2013 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package os 5 package os
6
7 // TODO(dfc) copied from FreeBSD, might be wrong
8 6
9 import ( 7 import (
10 "syscall" 8 "syscall"
11 "time" 9 "time"
12 ) 10 )
13 11
14 func sameFile(fs1, fs2 *fileStat) bool { 12 func sameFile(fs1, fs2 *fileStat) bool {
15 stat1 := fs1.sys.(*syscall.Stat_t) 13 stat1 := fs1.sys.(*syscall.Stat_t)
16 stat2 := fs2.sys.(*syscall.Stat_t) 14 stat2 := fs2.sys.(*syscall.Stat_t)
17 return stat1.Dev == stat2.Dev && stat1.Ino == stat2.Ino 15 return stat1.Dev == stat2.Dev && stat1.Ino == stat2.Ino
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 52 }
55 53
56 func timespecToTime(ts syscall.Timespec) time.Time { 54 func timespecToTime(ts syscall.Timespec) time.Time {
57 return time.Unix(int64(ts.Sec), int64(ts.Nsec)) 55 return time.Unix(int64(ts.Sec), int64(ts.Nsec))
58 } 56 }
59 57
60 // For testing. 58 // For testing.
61 func atime(fi FileInfo) time.Time { 59 func atime(fi FileInfo) time.Time {
62 return timespecToTime(fi.Sys().(*syscall.Stat_t).Atim) 60 return timespecToTime(fi.Sys().(*syscall.Stat_t).Atim)
63 } 61 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b