Windows: Fix crash in docker system prune

Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit e5900ee9bf)
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
John Howard 2016-12-09 10:02:44 -08:00 committed by Victor Vieux
parent 85ae13f6d0
commit 09cd31b128
1 changed files with 2 additions and 0 deletions

View File

@ -115,6 +115,8 @@ func readInputEvents(fd uintptr, maxBytes int) ([]winterm.INPUT_RECORD, error) {
countRecords := maxBytes / recordSize
if countRecords > ansiterm.MAX_INPUT_EVENTS {
countRecords = ansiterm.MAX_INPUT_EVENTS
} else if countRecords == 0 {
countRecords = 1
}
logger.Debugf("[windows] readInputEvents: Reading %v records (buffer size %v, record size %v)", countRecords, maxBytes, recordSize)