diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-14 18:30:22 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-14 18:30:22 +0900 |
| commit | 7c60a4d8e8baa77b42789c041838fa82dd7d36f9 (patch) | |
| tree | b859b33bd4d522229e2b497992ef42243f1b22d7 /helper/direct.go | |
| parent | 4bb5d9780f3c46e942dc778d93c28391caee33c7 (diff) | |
helper: embed context on creation
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'helper/direct.go')
| -rw-r--r-- | helper/direct.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/helper/direct.go b/helper/direct.go index 9198952d..fcc7b4e8 100644 --- a/helper/direct.go +++ b/helper/direct.go @@ -16,7 +16,7 @@ type direct struct { *helperCmd } -func (h *direct) Start(ctx context.Context, stat bool) error { +func (h *direct) Start(stat bool) error { h.lock.Lock() defer h.lock.Unlock() @@ -26,15 +26,15 @@ func (h *direct) Start(ctx context.Context, stat bool) error { return errors.New("exec: already started") } - args := h.finalise(ctx, stat) + args := h.finalise(stat) h.Cmd.Args = append(h.Cmd.Args, args...) - return proc.Fulfill(ctx, h.Cmd, h.files, h.extraFiles) + return proc.Fulfill(h.ctx, h.Cmd, h.files, h.extraFiles) } // New initialises a new direct Helper instance with wt as the null-terminated argument writer. // Function argF returns an array of arguments passed directly to the child process. -func New(wt io.WriterTo, name string, argF func(argsFd, statFd int) []string) Helper { +func New(ctx context.Context, wt io.WriterTo, name string, argF func(argsFd, statFd int) []string) Helper { d := new(direct) - d.helperCmd = newHelperCmd(d, name, wt, argF, nil) + d.helperCmd = newHelperCmd(d, ctx, name, wt, argF, nil) return d } |
