Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cmd/soft/serve/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ var (
}
continue
}
// A nil sig means doneOnce() closed `done` because the server
// goroutine returned, not because we got a real signal. The
// server's error sits in lch and the outer select could have
// dropped it (#645). Surface it before shutting down so that
// e.g. a permission-denied on :22 doesn't disappear silently.
if sig == nil {
select {
case err := <-lch:
if err != nil {
return fmt.Errorf("server error: %w", err)
}
default:
}
}
}

break
Expand Down