Skip to content

Commit a2a3dd0

Browse files
committed
os: add ModeCharDevice to ModeType
When masking FileInfo.Mode() from a character device with the ModeType mask, ModeCharDevice cannot be recovered. ModeCharDevice was added https://golang.org/cl/5531052, but nothing indicates why it was omitted from ModeType. Add it now. Fixes #27640 Change-Id: I52f56108b88b1b0a5bc6085c66c3c67e10600619 Reviewed-on: https://go-review.googlesource.com/135075 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
1 parent 1b93744 commit a2a3dd0

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎api/except.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pkg math/big, const MaxBase = 36
33
pkg math/big, type Word uintptr
44
pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
55
pkg os, const ModeType = 2399141888
6+
pkg os, const ModeType = 2399666176
67
pkg os (linux-arm), const O_SYNC = 4096
78
pkg os (linux-arm-cgo), const O_SYNC = 4096
89
pkg syscall (darwin-386), const ImplementsGetwd = false

‎src/os/types.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const (
5757
ModeIrregular // ?: non-regular file; nothing else is known about this file
5858

5959
// Mask for the type bits. For regular files, none will be set.
60-
ModeType = ModeDir | ModeSymlink | ModeNamedPipe | ModeSocket | ModeDevice | ModeIrregular
60+
ModeType = ModeDir | ModeSymlink | ModeNamedPipe | ModeSocket | ModeDevice | ModeCharDevice | ModeIrregular
6161

6262
ModePerm FileMode = 0777 // Unix permission bits
6363
)

0 commit comments

Comments
 (0)