]> Cypherpunks repositories - gostls13.git/commitdiff
os: mark Solaris nam/door/port files as irregular
authorIan Lance Taylor <iant@golang.org>
Sun, 10 Apr 2022 04:00:59 +0000 (21:00 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 12 Apr 2022 01:41:47 +0000 (01:41 +0000)
No test because I'm too lazy to figure out how to create such files.

Fixes #52259

Change-Id: I7a07f49993cf046888729e9206ed53dddcf9cb13
Reviewed-on: https://go-review.googlesource.com/c/go/+/399435
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/os/stat_solaris.go

index 316c26c7cab7af1e10ed3be1ace47d51d01c2b9e..4e00ecb075f3a5ac157ae7503d3cc707a1b4147d 100644 (file)
@@ -9,6 +9,14 @@ import (
        "time"
 )
 
+// These constants aren't in the syscall package, which is frozen.
+// Values taken from golang.org/x/sys/unix.
+const (
+       _S_IFNAM  = 0x5000
+       _S_IFDOOR = 0xd000
+       _S_IFPORT = 0xe000
+)
+
 func fillFileStatFromSys(fs *fileStat, name string) {
        fs.name = basename(name)
        fs.size = fs.sys.Size
@@ -29,6 +37,8 @@ func fillFileStatFromSys(fs *fileStat, name string) {
                // nothing to do
        case syscall.S_IFSOCK:
                fs.mode |= ModeSocket
+       case _S_IFNAM, _S_IFDOOR, _S_IFPORT:
+               fs.mode |= ModeIrregular
        }
        if fs.sys.Mode&syscall.S_ISGID != 0 {
                fs.mode |= ModeSetgid