containerd build clean on Solaris (#203)
* containerd build clean on Solaris Signed-off-by: Amit Krishnan <krish.amit@gmail.com> * Vendor golang.org/x/sys Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
This commit is contained in:
parent
b5981e004f
commit
62e1370f91
207 changed files with 108211 additions and 234 deletions
|
@ -632,23 +632,3 @@ type stdio struct {
|
|||
stdout string
|
||||
stderr string
|
||||
}
|
||||
|
||||
func createStdio() (s stdio, err error) {
|
||||
tmp, err := ioutil.TempDir("", "ctr-")
|
||||
if err != nil {
|
||||
return s, err
|
||||
}
|
||||
// create fifo's for the process
|
||||
for name, fd := range map[string]*string{
|
||||
"stdin": &s.stdin,
|
||||
"stdout": &s.stdout,
|
||||
"stderr": &s.stderr,
|
||||
} {
|
||||
path := filepath.Join(tmp, name)
|
||||
if err := syscall.Mkfifo(path, 0755); err != nil && !os.IsExist(err) {
|
||||
return s, err
|
||||
}
|
||||
*fd = path
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
|
|
28
ctr/container_linux.go
Normal file
28
ctr/container_linux.go
Normal file
|
@ -0,0 +1,28 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func createStdio() (s stdio, err error) {
|
||||
tmp, err := ioutil.TempDir("", "ctr-")
|
||||
if err != nil {
|
||||
return s, err
|
||||
}
|
||||
// create fifo's for the process
|
||||
for name, fd := range map[string]*string{
|
||||
"stdin": &s.stdin,
|
||||
"stdout": &s.stdout,
|
||||
"stderr": &s.stderr,
|
||||
} {
|
||||
path := filepath.Join(tmp, name)
|
||||
if err := syscall.Mkfifo(path, 0755); err != nil && !os.IsExist(err) {
|
||||
return s, err
|
||||
}
|
||||
*fd = path
|
||||
}
|
||||
return s, nil
|
||||
}
|
9
ctr/container_solaris.go
Normal file
9
ctr/container_solaris.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
func createStdio() (s stdio, err error) {
|
||||
return s, errors.New("createStdio not implemented on Solaris")
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue