helper/seccomp: panic on invalid closeWrite use
All checks were successful
Test / Create distribution (push) Successful in 1m46s
Test / Run NixOS test (push) Successful in 4m39s

Returning an error here puts exporter in an invalid state. The caller should guard against this condition instead.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-02-07 12:58:20 +09:00
parent 5b7b3fa9a4
commit 568d7758d5

View File

@@ -40,7 +40,7 @@ func (e *exporter) closeWrite() error {
return *e.closeErr.Load()
}
if e.w == nil {
return fs.ErrInvalid
panic("closeWrite called on invalid exporter")
}
err := e.w.Close()
e.closeErr.Store(&err)