mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Remove panic from init
Print the error message to stderr if we are unable to return it back via the pipe to the parent process. Also, don't panic here as it is most likely a system or user error and not a programmer error. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -256,11 +256,13 @@ func (l *LinuxFactory) StartInitialization() (err error) {
|
||||
if _, ok := i.(*linuxStandardInit); ok {
|
||||
// Synchronisation only necessary for standard init.
|
||||
if werr := utils.WriteJSON(pipe, syncT{procError}); werr != nil {
|
||||
panic(err)
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
if werr := utils.WriteJSON(pipe, newSystemError(err)); werr != nil {
|
||||
panic(err)
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
return
|
||||
}
|
||||
// ensure that this pipe is always closed
|
||||
pipe.Close()
|
||||
|
||||
Reference in New Issue
Block a user