diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-10 01:20:16 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-10 01:21:01 +0900 |
| commit | 4246256d781f169b86f76d8654f6df5ffc6ddae6 (patch) | |
| tree | 71f05518ff960873661788c3dcf581eed314322b /internal/app/outcome.go | |
| parent | a941ac025f9f3a942cab04a6f2447e4cab0e616c (diff) | |
internal/app: hold config address in state
This can be removed eventually as it is barely used.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/outcome.go')
| -rw-r--r-- | internal/app/outcome.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/app/outcome.go b/internal/app/outcome.go index f4589938..0161755b 100644 --- a/internal/app/outcome.go +++ b/internal/app/outcome.go @@ -133,7 +133,7 @@ func (s *outcomeState) instancePath() *check.Absolute { return s.sc.SharePath.Ap func (s *outcomeState) runtimePath() *check.Absolute { return s.sc.RunDirPath.Append(s.id.String()) } // outcomeStateSys wraps outcomeState and [system.I]. Used on the priv side only. -// Implementations of outcomeOp must not access fields other than sys unless explicitly stated. +// Implementations of outcomeOp must not access fields other than sys and config unless explicitly stated. type outcomeStateSys struct { // Whether XDG_RUNTIME_DIR is used post hsu. useRuntimeDir bool @@ -141,6 +141,8 @@ type outcomeStateSys struct { sharePath *check.Absolute // Process-specific directory in XDG_RUNTIME_DIR, nil if unused. runtimeSharePath *check.Absolute + // Must not be modified by outcomeOp. + config *hst.Config sys *system.I *outcomeState @@ -206,7 +208,7 @@ type outcomeStateParams struct { // An implementation of outcomeOp must store cross-process states in exported fields only. type outcomeOp interface { // toSystem inflicts the current outcome on [system.I] in the priv side process. - toSystem(state *outcomeStateSys, config *hst.Config) error + toSystem(state *outcomeStateSys) error // toContainer inflicts the current outcome on [container.Params] in the shim process. // The implementation must not write to the Env field of [container.Params] as it will be overwritten |
