From 9e18d1de77b2c9bb24a51c2e99b060c6d06818ee Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 14 Mar 2025 23:23:57 +0900 Subject: helper/proc: pass extra files and start For integration with native container tooling. Signed-off-by: Ophestra --- helper/proc/files.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'helper/proc') diff --git a/helper/proc/files.go b/helper/proc/files.go index 24cc7225..e41c3ef1 100644 --- a/helper/proc/files.go +++ b/helper/proc/files.go @@ -60,7 +60,10 @@ func (f *ExtraFilesPre) copy(e []*os.File) []*os.File { } // Fulfill calls the [File.Fulfill] method on all files, starts cmd and blocks until all fulfillment completes. -func Fulfill(ctx context.Context, cmd *exec.Cmd, files []File, extraFiles *ExtraFilesPre) (err error) { +func Fulfill(ctx context.Context, + v *[]*os.File, start func() error, + files []File, extraFiles *ExtraFilesPre, +) (err error) { var ecs int for _, o := range files { ecs += o.ErrCount() @@ -77,8 +80,8 @@ func Fulfill(ctx context.Context, cmd *exec.Cmd, files []File, extraFiles *Extra } } - cmd.ExtraFiles = extraFiles.Files() - if err = cmd.Start(); err != nil { + *v = extraFiles.Files() + if err = start(); err != nil { return } -- cgit v1.3.1