]> Cypherpunks repositories - gostls13.git/commit
internal/syscall/unix: fix UTIME_OMIT for dragonfly
authorKir Kolyshkin <kolyshkin@gmail.com>
Thu, 30 May 2024 21:31:40 +0000 (14:31 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 18 Jun 2024 22:25:08 +0000 (22:25 +0000)
commit4f77a83589baa5a3038cc6e35615084dc7e5f0c1
tree64b676a4810f261f5798bc8a3f3dbc16783c5fbf
parent879ace143490dba75a8499c7f4cea43926423c0f
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>
src/internal/syscall/unix/at_sysnum_dragonfly.go