Call open file once on FreeBSD.

This commit is contained in:
Chris Howey 2015-05-05 20:47:02 -05:00
parent a1c8dac561
commit a8be9c32d0
1 changed files with 1 additions and 5 deletions

View File

@ -7,12 +7,8 @@ import (
) )
func (node *Node) OpenForReading() (*os.File, error) { func (node *Node) OpenForReading() (*os.File, error) {
file, err := os.OpenFile(node.path, os.O_RDONLY, 0)
if os.IsPermission(err) {
return os.OpenFile(node.path, os.O_RDONLY, 0) return os.OpenFile(node.path, os.O_RDONLY, 0)
} }
return file, err
}
func (node *Node) fillTimes(stat *syscall.Stat_t) { func (node *Node) fillTimes(stat *syscall.Stat_t) {
node.ChangeTime = time.Unix(stat.Ctimespec.Unix()) node.ChangeTime = time.Unix(stat.Ctimespec.Unix())