diff options
author | Andriy Gapon <avg@FreeBSD.org> | 2017-04-14 18:56:00 +0000 |
---|---|---|
committer | Andriy Gapon <avg@FreeBSD.org> | 2017-04-14 18:56:00 +0000 |
commit | 7248081159b591f826cb457f4e48d3ecdd142725 (patch) | |
tree | e31cc38adf15106f5ff6df89aec90d75665b8c88 /lib | |
parent | 89a08ff6ba190602d9c71ae1d224f9374958547a (diff) | |
download | src-7248081159b591f826cb457f4e48d3ecdd142725.tar.gz src-7248081159b591f826cb457f4e48d3ecdd142725.zip |
5704 libzfs can only handle 255 file descriptors
illumos/illumos-gate@bde3d612a7c090234c60e6e4578821237a5db135
https://github.com/illumos/illumos-gate/commit/bde3d612a7c090234c60e6e4578821237a5db135
https://www.illumos.org/issues/5704
libzfs uses fopen(), at least in libzfs_init(). If there are more than 255
filedescriptors open, fopen() will fail unless you give 'F' as the last mode
character. The fix would be to give 'rF' instead of 'r' as mode to fopen().
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Simon Klinkert <simon.klinkert@gmail.com>
Notes
Notes:
svn path=/vendor/illumos/dist/; revision=316935
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libzfs/common/libzfs_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libzfs/common/libzfs_util.c b/lib/libzfs/common/libzfs_util.c index 22f58663f461..b8a16a08d454 100644 --- a/lib/libzfs/common/libzfs_util.c +++ b/lib/libzfs/common/libzfs_util.c @@ -626,13 +626,13 @@ libzfs_init(void) return (NULL); } - if ((hdl->libzfs_mnttab = fopen(MNTTAB, "r")) == NULL) { + if ((hdl->libzfs_mnttab = fopen(MNTTAB, "rF")) == NULL) { (void) close(hdl->libzfs_fd); free(hdl); return (NULL); } - hdl->libzfs_sharetab = fopen("/etc/dfs/sharetab", "r"); + hdl->libzfs_sharetab = fopen("/etc/dfs/sharetab", "rF"); if (libzfs_core_init() != 0) { (void) close(hdl->libzfs_fd); |