mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
move notifySocket out of signalHandler
In fact, notifySocket has no relationship to signalHandler, we can move it out of signalHandler to make the code more clear. Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit is contained in:
+6
-1
@@ -258,7 +258,7 @@ func (r *runner) run(config *specs.Process) (_ int, retErr error) {
|
||||
// Setting up IO is a two stage process. We need to modify process to deal
|
||||
// with detaching containers, and then we get a tty after the container has
|
||||
// started.
|
||||
handlerCh := newSignalHandler(r.enableSubreaper, r.notifySocket)
|
||||
handlerCh := newSignalHandler(r.enableSubreaper)
|
||||
tty, err := setupIO(process, r.container, config.Terminal, detach, r.consoleSocket)
|
||||
if err != nil {
|
||||
return -1, err
|
||||
@@ -301,6 +301,11 @@ func (r *runner) run(config *specs.Process) (_ int, retErr error) {
|
||||
return -1, err
|
||||
}
|
||||
}
|
||||
if r.notifySocket != nil {
|
||||
if err = r.notifySocket.forward(process, detach); err != nil {
|
||||
return -1, err
|
||||
}
|
||||
}
|
||||
handler := <-handlerCh
|
||||
status, err := handler.forward(process, tty, detach)
|
||||
if detach {
|
||||
|
||||
Reference in New Issue
Block a user