diff options
author | Ian Lance Taylor <iant@google.com> | 2016-02-03 21:58:02 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-02-03 21:58:02 +0000 |
commit | f98dd1a338867a408f7c72d73fbad7fe7fc93e3a (patch) | |
tree | 2f8da9862a9c1fe0df138917f997b03439c02773 /libgo/go/os/stat_dragonfly.go | |
parent | b081ed4efc144da0c45a6484aebfd10e0eb9fda3 (diff) | |
download | gcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.zip gcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.tar.gz gcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.tar.bz2 |
libgo: Update to go1.6rc1.
Reviewed-on: https://go-review.googlesource.com/19200
From-SVN: r233110
Diffstat (limited to 'libgo/go/os/stat_dragonfly.go')
-rw-r--r-- | libgo/go/os/stat_dragonfly.go | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/libgo/go/os/stat_dragonfly.go b/libgo/go/os/stat_dragonfly.go index 605c1d9..69e6323 100644 --- a/libgo/go/os/stat_dragonfly.go +++ b/libgo/go/os/stat_dragonfly.go @@ -9,21 +9,12 @@ import ( "time" ) -func sameFile(fs1, fs2 *fileStat) bool { - stat1 := fs1.sys.(*syscall.Stat_t) - stat2 := fs2.sys.(*syscall.Stat_t) - return stat1.Dev == stat2.Dev && stat1.Ino == stat2.Ino -} - -func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo { - fs := &fileStat{ - name: basename(name), - size: int64(st.Size), - modTime: timespecToTime(st.Mtim), - sys: st, - } - fs.mode = FileMode(st.Mode & 0777) - switch st.Mode & syscall.S_IFMT { +func fillFileStatFromSys(fs *fileStat, name string) { + fs.name = basename(name) + fs.size = int64(fs.sys.Size) + fs.modTime = timespecToTime(fs.sys.Mtim) + fs.mode = FileMode(fs.sys.Mode & 0777) + switch fs.sys.Mode & syscall.S_IFMT { case syscall.S_IFBLK: fs.mode |= ModeDevice case syscall.S_IFCHR: @@ -39,16 +30,15 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo { case syscall.S_IFSOCK: fs.mode |= ModeSocket } - if st.Mode&syscall.S_ISGID != 0 { + if fs.sys.Mode&syscall.S_ISGID != 0 { fs.mode |= ModeSetgid } - if st.Mode&syscall.S_ISUID != 0 { + if fs.sys.Mode&syscall.S_ISUID != 0 { fs.mode |= ModeSetuid } - if st.Mode&syscall.S_ISVTX != 0 { + if fs.sys.Mode&syscall.S_ISVTX != 0 { fs.mode |= ModeSticky } - return fs } func timespecToTime(ts syscall.Timespec) time.Time { |