Print this page
5704 libzfs can only handle 255 filedescriptors

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libzfs/common/libzfs_util.c
          +++ new/usr/src/lib/libzfs/common/libzfs_util.c
↓ open down ↓ 616 lines elided ↑ open up ↑
 617  617  
 618  618          if ((hdl = calloc(1, sizeof (libzfs_handle_t))) == NULL) {
 619  619                  return (NULL);
 620  620          }
 621  621  
 622  622          if ((hdl->libzfs_fd = open(ZFS_DEV, O_RDWR)) < 0) {
 623  623                  free(hdl);
 624  624                  return (NULL);
 625  625          }
 626  626  
 627      -        if ((hdl->libzfs_mnttab = fopen(MNTTAB, "r")) == NULL) {
      627 +        if ((hdl->libzfs_mnttab = fopen(MNTTAB, "rF")) == NULL) {
 628  628                  (void) close(hdl->libzfs_fd);
 629  629                  free(hdl);
 630  630                  return (NULL);
 631  631          }
 632  632  
 633      -        hdl->libzfs_sharetab = fopen("/etc/dfs/sharetab", "r");
      633 +        hdl->libzfs_sharetab = fopen("/etc/dfs/sharetab", "rF");
 634  634  
 635  635          if (libzfs_core_init() != 0) {
 636  636                  (void) close(hdl->libzfs_fd);
 637  637                  (void) fclose(hdl->libzfs_mnttab);
 638  638                  (void) fclose(hdl->libzfs_sharetab);
 639  639                  free(hdl);
 640  640                  return (NULL);
 641  641          }
 642  642  
 643  643          zfs_prop_init();
↓ open down ↓ 858 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX