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/12648
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Matt Layher
2015-07-24 17:09:24 -04:00
committed by Rob Pike
parent 2019c8d05e
commit 2c41184ab0

View File

@@ -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
}