aboutsummaryrefslogtreecommitdiffhomepage
path: root/fst
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-02-19 21:05:48 +0900
committerOphestra <cat@gensokyo.uk>2025-02-19 21:12:11 +0900
commit3c80fd2b0f907af7b179e9e307304c0fa52994a0 (patch)
treef52e8ed67f94f4ff8c423cd1e8b06fef82918c93 /fst
parentef81828e0c1ce6277e0b124f6062eab564dfeceb (diff)
app: defer system.I revert
Just returning an error after a successful call of commit will leave garbage behind with no way for the caller to clean them. This change ensures revert is always called after successful commit with at least per-process state enabled. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'fst')
-rw-r--r--fst/app.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/fst/app.go b/fst/app.go
index 95d00dda..e1a17f16 100644
--- a/fst/app.go
+++ b/fst/app.go
@@ -1,6 +1,9 @@
package fst
-import "context"
+import (
+ "context"
+ "time"
+)
type App interface {
// ID returns a copy of App's unique ID.
@@ -14,10 +17,15 @@ type App interface {
// RunState stores the outcome of a call to [App.Run].
type RunState struct {
- // Start is true if fsu is successfully started.
- Start bool
+ // Time is the exact point in time where the process was created.
+ // Location must be set to UTC.
+ //
+ // Time is nil if no process was ever created.
+ Time *time.Time
// ExitCode is the value returned by shim.
ExitCode int
+ // RevertErr is stored by the deferred revert call.
+ RevertErr error
// WaitErr is error returned by the underlying wait syscall.
WaitErr error
}