7060790: (fs) FileSystem.newWatchService error message confusing when maximum inotify descriptors reached

Reviewed-by: forax
This commit is contained in:
Alan Bateman 2011-08-27 15:40:45 +01:00
parent ca2767a5d3
commit cf6e15a2e3
2 changed files with 5 additions and 1 deletions
jdk/src/solaris
classes/sun/nio/fs
native/sun/nio/fs

@ -58,7 +58,10 @@ class LinuxWatchService
try {
ifd = inotifyInit();
} catch (UnixException x) {
throw new IOException(x.errorString());
String msg = (x.errno() == EMFILE) ?
"User limit of inotify instances reached or too many open files" :
x.errorString();
throw new IOException(msg);
}
// configure inotify to be non-blocking

@ -108,6 +108,7 @@ int main(int argc, const char* argv[]) {
DEF(EROFS);
DEF(ENODATA);
DEF(ERANGE);
DEF(EMFILE);
// flags used with openat/unlinkat/etc.
#if defined(AT_SYMLINK_NOFOLLOW) && defined(AT_REMOVEDIR)