8203369: Check for both EAGAIN and EWOULDBLOCK error codes

Reviewed-by: alanb
This commit is contained in:
Ivan Gerasimov 2018-05-25 12:44:34 -07:00
parent a9d29cf43a
commit 33b7f68964
7 changed files with 22 additions and 23 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -319,7 +319,7 @@ class LinuxWatchService
try {
bytesRead = read(ifd, address, BUFFER_SIZE);
} catch (UnixException x) {
if (x.errno() != EAGAIN)
if (x.errno() != EAGAIN && x.errno() != EWOULDBLOCK)
throw x;
bytesRead = 0;
}
@ -367,7 +367,7 @@ class LinuxWatchService
if (shutdown)
break;
} catch (UnixException x) {
if (x.errno() != UnixConstants.EAGAIN)
if (x.errno() != EAGAIN && x.errno() != EWOULDBLOCK)
throw x;
}
}