Commit 2c41184a authored by Matt Layher's avatar Matt Layher Committed by Rob Pike

x/sys/unix: allow nil argument slice for Utimes on Linux

Fixes golang/go#11830.

Change-Id: Ie7ffd4579a7b8143ca85a30d24acd3e2e7eece78
Reviewed-on: https://go-review.googlesource.com/12648Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: 's avatarRob Pike <r@golang.org>
parent 2019c8d0
......@@ -93,6 +93,9 @@ func Unlinkat(dirfd int, path string) error {
//sys utimes(path string, times *[2]Timeval) (err error)
func Utimes(path string, tv []Timeval) (err error) {
if tv == nil {
return utimes(path, nil)
}
if len(tv) != 2 {
return EINVAL
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment