mirror of
https://github.com/golang/sys.git
synced 2026-02-08 11:46:04 +03:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user