space: 32-bit builds — stat fields are int32 there
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
fc5236471e
commit
41e63f74e9
@@ -90,7 +90,7 @@ func Walk(ctx context.Context, roots []string, progress func(Progress)) (*Node,
|
|||||||
if err := syscall.Lstat(r, &st); err != nil || st.Mode&syscall.S_IFMT != syscall.S_IFDIR {
|
if err := syscall.Lstat(r, &st); err != nil || st.Mode&syscall.S_IFMT != syscall.S_IFDIR {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
n := &Node{Name: filepath.Base(r), Dir: true, MTime: st.Mtim.Sec}
|
n := &Node{Name: filepath.Base(r), Dir: true, MTime: int64(st.Mtim.Sec)}
|
||||||
if r == "/" {
|
if r == "/" {
|
||||||
n = root
|
n = root
|
||||||
}
|
}
|
||||||
@@ -211,7 +211,7 @@ func (w *walker) readDir(j job) {
|
|||||||
}
|
}
|
||||||
switch st.Mode & syscall.S_IFMT {
|
switch st.Mode & syscall.S_IFMT {
|
||||||
case syscall.S_IFDIR:
|
case syscall.S_IFDIR:
|
||||||
c := &Node{Name: name, Dir: true, MTime: st.Mtim.Sec}
|
c := &Node{Name: name, Dir: true, MTime: int64(st.Mtim.Sec)}
|
||||||
j.node.Children = append(j.node.Children, c)
|
j.node.Children = append(j.node.Children, c)
|
||||||
if uint64(st.Dev) != j.dev {
|
if uint64(st.Dev) != j.dev {
|
||||||
c.Mount = true // something else is mounted here; if it is this disk's too, it is a root of its own
|
c.Mount = true // something else is mounted here; if it is this disk's too, it is a root of its own
|
||||||
@@ -219,15 +219,15 @@ func (w *walker) readDir(j job) {
|
|||||||
}
|
}
|
||||||
w.push(job{path: p, node: c, dev: j.dev})
|
w.push(job{path: p, node: c, dev: j.dev})
|
||||||
case syscall.S_IFREG, syscall.S_IFLNK:
|
case syscall.S_IFREG, syscall.S_IFLNK:
|
||||||
alloc := st.Blocks * 512
|
alloc := int64(st.Blocks) * 512
|
||||||
w.files.Add(1)
|
w.files.Add(1)
|
||||||
w.bytes.Add(alloc)
|
w.bytes.Add(alloc)
|
||||||
if alloc >= KeepMin || st.Size >= KeepMin {
|
if alloc >= KeepMin || int64(st.Size) >= KeepMin {
|
||||||
j.node.Children = append(j.node.Children, &Node{Name: name, Size: alloc, Apparent: st.Size, MTime: st.Mtim.Sec})
|
j.node.Children = append(j.node.Children, &Node{Name: name, Size: alloc, Apparent: int64(st.Size), MTime: int64(st.Mtim.Sec)})
|
||||||
} else {
|
} else {
|
||||||
j.node.SmallN++
|
j.node.SmallN++
|
||||||
j.node.SmallSize += alloc
|
j.node.SmallSize += alloc
|
||||||
j.node.Apparent += st.Size // added to the directory's own apparent total below
|
j.node.Apparent += int64(st.Size) // added to the directory's own apparent total below
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user