mirror of
https://github.com/criyle/go-sandbox.git
synced 2025-11-04 14:49:53 +08:00
fix typo & mount param
This commit is contained in:
parent
6e46a73289
commit
6a91022c58
@ -7,9 +7,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
bind = unix.MS_BIND | unix.MS_NOSUID | unix.MS_NOATIME | unix.MS_PRIVATE
|
bind = unix.MS_BIND | unix.MS_NOSUID | unix.MS_PRIVATE
|
||||||
roBind = bind | unix.MS_RDONLY
|
roBind = bind | unix.MS_RDONLY
|
||||||
mFlag = unix.MS_NOSUID | unix.MS_NOATIME | unix.MS_NODEV | unix.MS_PRIVATE
|
mFlag = unix.MS_NOSUID | unix.MS_NOATIME | unix.MS_NODEV
|
||||||
)
|
)
|
||||||
|
|
||||||
// Builder builds fork_exec friendly mount syscall format
|
// Builder builds fork_exec friendly mount syscall format
|
||||||
@ -23,7 +23,7 @@ func NewBuilder() *Builder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build creates sequence of syscalls for fork_exec
|
// Build creates sequence of syscalls for fork_exec
|
||||||
// skipNotExists skips bind mounts that source not exitst
|
// skipNotExists skips bind mounts that source not exists
|
||||||
func (b *Builder) Build(skipNotExists bool) ([]SyscallParams, error) {
|
func (b *Builder) Build(skipNotExists bool) ([]SyscallParams, error) {
|
||||||
ret := make([]SyscallParams, 0, len(b.Mounts))
|
ret := make([]SyscallParams, 0, len(b.Mounts))
|
||||||
for _, m := range b.Mounts {
|
for _, m := range b.Mounts {
|
||||||
|
|||||||
@ -36,7 +36,7 @@ func NewPipe(writer io.Writer, n int64) (<-chan struct{}, *os.File, error) {
|
|||||||
|
|
||||||
// NewBuffer creates a os pipe, caller need to
|
// NewBuffer creates a os pipe, caller need to
|
||||||
// caller need to close w
|
// caller need to close w
|
||||||
// Notice: if rely on doen for finish, w need be closed in parent process
|
// Notice: if rely on done for finish, w need be closed in parent process
|
||||||
func NewBuffer(max int64) (*Buffer, error) {
|
func NewBuffer(max int64) (*Buffer, error) {
|
||||||
buffer := new(bytes.Buffer)
|
buffer := new(bytes.Buffer)
|
||||||
done, w, err := NewPipe(buffer, max+1)
|
done, w, err := NewPipe(buffer, max+1)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user