]> Cypherpunks repositories - gostls13.git/commitdiff
os: add ModeCharDevice to ModeType
authorTobias Klauser <tklauser@distanz.ch>
Wed, 12 Sep 2018 19:30:09 +0000 (21:30 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Thu, 13 Sep 2018 09:52:57 +0000 (09:52 +0000)
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>
api/except.txt
src/os/types.go

index 850724196d2492cab829f813d346ebbed4c2195f..9f7f3fe934ad4580bcb35d5d6bb70d2ebc8db5eb 100644 (file)
@@ -3,6 +3,7 @@ pkg math/big, const MaxBase = 36
 pkg math/big, type Word uintptr
 pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
 pkg os, const ModeType = 2399141888
+pkg os, const ModeType = 2399666176
 pkg os (linux-arm), const O_SYNC = 4096
 pkg os (linux-arm-cgo), const O_SYNC = 4096
 pkg syscall (darwin-386), const ImplementsGetwd = false
index b0b7d8d94d6203ee4dc206be4bfca556ef0dab20..4b6c084838b6b14ab9b788a31583659dfaab1760 100644 (file)
@@ -57,7 +57,7 @@ const (
        ModeIrregular                                  // ?: non-regular file; nothing else is known about this file
 
        // Mask for the type bits. For regular files, none will be set.
-       ModeType = ModeDir | ModeSymlink | ModeNamedPipe | ModeSocket | ModeDevice | ModeIrregular
+       ModeType = ModeDir | ModeSymlink | ModeNamedPipe | ModeSocket | ModeDevice | ModeCharDevice | ModeIrregular
 
        ModePerm FileMode = 0777 // Unix permission bits
 )