mirror of
https://github.com/containers/podman.git
synced 2025-06-22 01:48:54 +08:00
remove unnecessary conversions
Signed-off-by: Peter Hunt <pehunt@redhat.com>
This commit is contained in:
@ -808,7 +808,7 @@ func (i *LibpodAPI) ExecContainer(call iopodman.VarlinkCall, opts iopodman.ExecO
|
|||||||
resizeChan := make(chan remotecommand.TerminalSize)
|
resizeChan := make(chan remotecommand.TerminalSize)
|
||||||
|
|
||||||
reader, writer, _, pipeWriter, streams := setupStreams(call)
|
reader, writer, _, pipeWriter, streams := setupStreams(call)
|
||||||
//reader, _, _, pipeWriter, streams := setupStreams(call)
|
|
||||||
type ExitCodeError struct {
|
type ExitCodeError struct {
|
||||||
ExitCode uint32
|
ExitCode uint32
|
||||||
Error error
|
Error error
|
||||||
@ -837,8 +837,7 @@ func (i *LibpodAPI) ExecContainer(call iopodman.VarlinkCall, opts iopodman.ExecO
|
|||||||
|
|
||||||
ecErr := <-ecErrChan
|
ecErr := <-ecErrChan
|
||||||
|
|
||||||
// TODO FIXME prevent all of these conversions
|
exitCode := ecErr.ExitCode
|
||||||
exitCode := int(ecErr.ExitCode)
|
|
||||||
if errors.Cause(ecErr.Error) == define.ErrOCIRuntimePermissionDenied {
|
if errors.Cause(ecErr.Error) == define.ErrOCIRuntimePermissionDenied {
|
||||||
exitCode = define.ExecErrorCodeCannotInvoke
|
exitCode = define.ExecErrorCodeCannotInvoke
|
||||||
}
|
}
|
||||||
|
@ -171,11 +171,11 @@ func Reader(r *bufio.Reader, output, errput, input io.Writer, resize chan remote
|
|||||||
}
|
}
|
||||||
|
|
||||||
// HangUp sends message to peer to close connection
|
// HangUp sends message to peer to close connection
|
||||||
func HangUp(writer *bufio.Writer, ec int) (err error) {
|
func HangUp(writer *bufio.Writer, ec uint32) (err error) {
|
||||||
n := 0
|
n := 0
|
||||||
msg := make([]byte, 4)
|
msg := make([]byte, 4)
|
||||||
|
|
||||||
binary.BigEndian.PutUint32(msg, uint32(ec))
|
binary.BigEndian.PutUint32(msg, ec)
|
||||||
|
|
||||||
writeQuit := NewVirtWriteCloser(writer, Quit)
|
writeQuit := NewVirtWriteCloser(writer, Quit)
|
||||||
if n, err = writeQuit.Write(msg); err != nil {
|
if n, err = writeQuit.Write(msg); err != nil {
|
||||||
|
Reference in New Issue
Block a user