浏览代码

Merge pull request #27311 from darrenstahlmsft/CloseStdinError

Windows: Stop returning errors that should be ignored while closing stdin
Victor Vieux 8 年之前
父节点
当前提交
2ee6032c88
共有 1 个文件被更改,包括 2 次插入5 次删除
  1. 2 5
      libcontainerd/process_windows.go

+ 2 - 5
libcontainerd/process_windows.go

@@ -38,17 +38,14 @@ func createStdInCloser(pipe io.WriteCloser, process hcsshim.Process) io.WriteClo
 			return err
 		}
 
-		// We do not need to lock container ID here, even though
-		// we are calling into hcsshim. This is safe, because the
-		// only place that closes this process handle is this method.
 		err := process.CloseStdin()
-		if err != nil && !hcsshim.IsNotExist(err) {
+		if err != nil && !hcsshim.IsNotExist(err) && !hcsshim.IsAlreadyClosed(err) {
 			// This error will occur if the compute system is currently shutting down
 			if perr, ok := err.(*hcsshim.ProcessError); ok && perr.Err != hcsshim.ErrVmcomputeOperationInvalidState {
 				return err
 			}
 		}
 
-		return err
+		return nil
 	})
 }