Make utils_daemon and volumes cross-platform compileable.
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
This commit is contained in:
parent
718f112173
commit
a5e54d5788
7 changed files with 30 additions and 16 deletions
|
@ -4,11 +4,20 @@ import (
|
|||
"syscall"
|
||||
)
|
||||
|
||||
func fromStatT(s *syscall.Stat_t) (*Stat, error) {
|
||||
return &Stat{size: s.Size,
|
||||
func fromStatT(s *syscall.Stat_t) (*Stat_t, error) {
|
||||
return &Stat_t{size: s.Size,
|
||||
mode: s.Mode,
|
||||
uid: s.Uid,
|
||||
gid: s.Gid,
|
||||
rdev: s.Rdev,
|
||||
mtim: s.Mtim}, nil
|
||||
}
|
||||
|
||||
func Stat(path string) (*Stat_t, error) {
|
||||
s := &syscall.Stat_t{}
|
||||
err := syscall.Stat(path, s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return fromStatT(s)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue