Commit 49325dc1 authored by David du Colombier's avatar David du Colombier

os: fix TestDevNullFile on Plan 9

CL 102457 added TestDevNullFile. However, this
test is failing on Plan 9, because it checks
that /dev/null is a character device while there
are no special files on Plan 9.

We fix this issue by changing Stat to consider
all files served by the console device (#c)
as character devices.

Fixes #24534.

Change-Id: I1c60cdf25770358b908790b3fb71910fa914dec0
Reviewed-on: https://go-review.googlesource.com/102424
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: 's avatarAlex Brainman <alex.brainman@gmail.com>
Reviewed-by: 's avatarRob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 131901e8
...@@ -35,6 +35,10 @@ func fileInfoFromStat(d *syscall.Dir) FileInfo { ...@@ -35,6 +35,10 @@ func fileInfoFromStat(d *syscall.Dir) FileInfo {
if d.Type != 'M' { if d.Type != 'M' {
fs.mode |= ModeDevice fs.mode |= ModeDevice
} }
// Consider all files served by #c as character device files.
if d.Type == 'c' {
fs.mode |= ModeCharDevice
}
return fs return fs
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment