提交 d4e57853 编写于 作者: A alanb

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

7060790: (fs) FileSystem.newWatchService error message confusing when maximum inotify descriptors reached
Reviewed-by: forax
上级 78df7a40
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册