Skip to content

Commit 3205598

Browse files
committed
Fix fsck not exiting in TUI mode
1 parent a6fd8a4 commit 3205598

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cmd/fsck/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,19 @@ func main() {
9898

9999
checkResult <- err
100100
close(checkResult)
101+
cancel() // We're done, so we can exit.
101102
}()
102103

103104
if *ui {
104105
if err := tui.RunApp(ctx, f); err != nil {
105106
slog.ErrorContext(ctx, "App exited", slog.Any("error", err))
106107
}
107-
// User may have exited the UI, cancel the context to signal to everything else.
108+
// User may have exited the UI, cancel the context to signal to the async fsck process too.
108109
cancel()
109110
} else {
110111
for {
111112
select {
112113
case err := <-checkResult:
113-
cancel()
114114
if err != nil {
115115
slog.ErrorContext(ctx, "fsck failed", slog.Any("error", err))
116116
os.Exit(1)

0 commit comments

Comments
 (0)