Vendor changes

Vendoring (NEW) in github.com/Microsoft/hcsshim
This commit is contained in:
Madhan Raj Mookkandy
2017-08-25 12:41:16 -07:00
parent 5b87513972
commit 63020d5f72
50 changed files with 7013 additions and 564 deletions

33
vendor/github.com/Microsoft/hcsshim/utils.go generated vendored Normal file
View File

@@ -0,0 +1,33 @@
package hcsshim
import (
"io"
"syscall"
"github.com/Microsoft/go-winio"
)
// makeOpenFiles calls winio.MakeOpenFile for each handle in a slice but closes all the handles
// if there is an error.
func makeOpenFiles(hs []syscall.Handle) (_ []io.ReadWriteCloser, err error) {
fs := make([]io.ReadWriteCloser, len(hs))
for i, h := range hs {
if h != syscall.Handle(0) {
if err == nil {
fs[i], err = winio.MakeOpenFile(h)
}
if err != nil {
syscall.Close(h)
}
}
}
if err != nil {
for _, f := range fs {
if f != nil {
f.Close()
}
}
return nil, err
}
return fs, nil
}