x/sys/unix: allow nil on unix for all variants of Utimes

Fixes golang/go#11830.

Change-Id: Ie6e9f82d05b7c04092b6ee6117238873b746380e
Reviewed-on: https://go-review.googlesource.com/12690
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Rob Pike
2015-07-27 05:51:57 +00:00
parent 2c41184ab0
commit 3826714b1e
3 changed files with 35 additions and 10 deletions
+4 -1
View File
@@ -270,7 +270,10 @@ func Gethostname() (name string, err error) {
return name, err
}
func UtimesNano(path string, ts []Timespec) (err error) {
func UtimesNano(path string, ts []Timespec) error {
if ts == nil {
return Utimes(path, nil)
}
if len(ts) != 2 {
return EINVAL
}