瀏覽代碼

Windows: Don't shadow err variable

Signed-off-by: John Howard <jhoward@microsoft.com>
John Howard 6 年之前
父節點
當前提交
afa3aec024
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      libcontainerd/local/local_windows.go

+ 3 - 1
libcontainerd/local/local_windows.go

@@ -724,7 +724,9 @@ func (c *client) Start(_ context.Context, id, _ string, withStdin bool, attachSt
 	// Spin up a go routine waiting for exit to handle cleanup
 	// Spin up a go routine waiting for exit to handle cleanup
 	go c.reapProcess(ctr, p)
 	go c.reapProcess(ctr, p)
 
 
-	dio, err := newIOFromProcess(newProcess, ctr.ociSpec.Process.Terminal)
+	// Don't shadow err here due to our deferred clean-up.
+	var dio *cio.DirectIO
+	dio, err = newIOFromProcess(newProcess, ctr.ociSpec.Process.Terminal)
 	if err != nil {
 	if err != nil {
 		logger.WithError(err).Error("failed to get stdio pipes")
 		logger.WithError(err).Error("failed to get stdio pipes")
 		return -1, err
 		return -1, err