mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
libcontainer/ignoreTerminateErrors: simplify for Go 1.16+
One less TODO in the code, yay! Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -2150,13 +2150,11 @@ func ignoreTerminateErrors(err error) error {
|
||||
if errors.As(err, &exitErr) {
|
||||
return nil
|
||||
}
|
||||
// TODO: use errors.Is(err, os.ErrProcessDone) here and
|
||||
// remove "process already finished" string comparison below
|
||||
// once go 1.16 is minimally supported version.
|
||||
|
||||
if errors.Is(err, os.ErrProcessDone) {
|
||||
return nil
|
||||
}
|
||||
s := err.Error()
|
||||
if strings.Contains(s, "process already finished") ||
|
||||
strings.Contains(s, "Wait was already called") {
|
||||
if strings.Contains(s, "Wait was already called") {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user