aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKir Kolyshkin <kolyshkin@gmail.com>2024-05-30 14:31:40 -0700
committerDavid Chase <drchase@google.com>2024-06-20 19:13:34 +0000
commitf3bdcda88a5cf060592657df3d1179309bb8d028 (patch)
treeaf0f2148b4ab044702021000a63f1d336b7ba876
parent362f22d2d2fd52260338ee48fc3baa573749f8ce (diff)
downloadgo-f3bdcda88a5cf060592657df3d1179309bb8d028.tar.xz
[release-branch.go1.23] internal/syscall/unix: fix UTIME_OMIT for dragonfly
CL 219638 added UTIME_OMIT values for various systems. The value for DragonFly BSD appears to be incorrect. The correct value is -2 (see references below), while -1 is used for UTIME_NOW. As a result, timestamp is changed to the current time instead of not touching. This should have been caught by the accompanying test case, TestChtimesWithZeroTimes, but its failures are essentially skipped on dragonfly (this is being fixed separately in a followup CL 591535). Improve formatting while at it. References: - https://github.com/DragonFlyBSD/DragonFlyBSD/blob/965b380e9609/sys/sys/stat.h#L284 - https://go.googlesource.com/sys/+/refs/tags/v0.20.0/unix/zerrors_dragonfly_amd64.go#1421 Change-Id: I432360ca982c84b7cd70d0cf01d860af9ff985fa Reviewed-on: https://go-review.googlesource.com/c/go/+/589496 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Commit-Queue: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/593796 Reviewed-by: Michael Pratt <mpratt@google.com>
-rw-r--r--src/internal/syscall/unix/at_sysnum_dragonfly.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/internal/syscall/unix/at_sysnum_dragonfly.go b/src/internal/syscall/unix/at_sysnum_dragonfly.go
index 9ac1f919f1..a8164dcc8e 100644
--- a/src/internal/syscall/unix/at_sysnum_dragonfly.go
+++ b/src/internal/syscall/unix/at_sysnum_dragonfly.go
@@ -6,15 +6,15 @@ package unix
import "syscall"
-const unlinkatTrap uintptr = syscall.SYS_UNLINKAT
-const openatTrap uintptr = syscall.SYS_OPENAT
-const fstatatTrap uintptr = syscall.SYS_FSTATAT
-
const (
+ unlinkatTrap uintptr = syscall.SYS_UNLINKAT
+ openatTrap uintptr = syscall.SYS_OPENAT
+ fstatatTrap uintptr = syscall.SYS_FSTATAT
+
AT_EACCESS = 0x4
AT_FDCWD = 0xfffafdcd
AT_REMOVEDIR = 0x2
AT_SYMLINK_NOFOLLOW = 0x1
- UTIME_OMIT = -0x1
+ UTIME_OMIT = -0x2
)