diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-15 01:02:18 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-15 01:06:31 +0900 |
| commit | f9bf20a3c75d01cf597477231f9bbb61f15cd4fd (patch) | |
| tree | 702c804f7715b53888ab77b497d216a9cf673f2e /helper/bwrap.go | |
| parent | 73c1a830320636f91a0d15d6d247e88650e81df1 (diff) | |
helper: rearrange initialisation args
This improves consistency across two different helper implementations.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'helper/bwrap.go')
| -rw-r--r-- | helper/bwrap.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/helper/bwrap.go b/helper/bwrap.go index 7ced938d..7e9e9bcf 100644 --- a/helper/bwrap.go +++ b/helper/bwrap.go @@ -51,17 +51,17 @@ func (b *bubblewrap) Start() error { // Function argF returns an array of arguments passed directly to the child process. func MustNewBwrap( ctx context.Context, - conf *bwrap.Config, name string, - setpgid bool, wt io.WriterTo, - argF func(argsFD, statFD int) []string, + stat bool, + argF func(argsFd, statFd int) []string, cmdF func(cmd *exec.Cmd), + conf *bwrap.Config, + setpgid bool, extraFiles []*os.File, syncFd *os.File, - stat bool, ) Helper { - b, err := NewBwrap(ctx, conf, name, setpgid, wt, argF, cmdF, extraFiles, syncFd, stat) + b, err := NewBwrap(ctx, name, wt, stat, argF, cmdF, conf, setpgid, extraFiles, syncFd) if err != nil { panic(err.Error()) } else { @@ -74,20 +74,20 @@ func MustNewBwrap( // Function argF returns an array of arguments passed directly to the child process. func NewBwrap( ctx context.Context, - conf *bwrap.Config, name string, - setpgid bool, wt io.WriterTo, + stat bool, argF func(argsFd, statFd int) []string, cmdF func(cmd *exec.Cmd), + conf *bwrap.Config, + setpgid bool, extraFiles []*os.File, syncFd *os.File, - stat bool, ) (Helper, error) { b := new(bubblewrap) b.name = name - b.helperCmd = newHelperCmd(ctx, BubblewrapName, wt, argF, extraFiles, stat) + b.helperCmd = newHelperCmd(ctx, BubblewrapName, wt, argF, stat, extraFiles) if setpgid { b.Cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} } |
