Print this page
5255 uts shouldn't open-code ISP2

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/krtld/kobj.c
          +++ new/usr/src/uts/common/krtld/kobj.c
↓ open down ↓ 3779 lines elided ↑ open up ↑
3780 3780          file->_dsize = cip->fsize;
3781 3781          file->_dbuf = kobj_alloc(cip->fsize, KM_WAIT|KM_TMP);
3782 3782          if (kobj_read(file->_fd, file->_dbuf, cip->fsize, 0) != cip->fsize) {
3783 3783                  kobj_free(file->_dbuf, cip->fsize);
3784 3784                  return (-1);
3785 3785          }
3786 3786  
3787 3787          hdr = kobj_comphdr(file);
3788 3788          if (hdr->ch_magic != CH_MAGIC_ZLIB || hdr->ch_version != CH_VERSION ||
3789 3789              hdr->ch_algorithm != CH_ALG_ZLIB || hdr->ch_fsize == 0 ||
3790      -            (hdr->ch_blksize & (hdr->ch_blksize - 1)) != 0) {
     3790 +            !ISP2(hdr->ch_blksize)) {
3791 3791                  kobj_free(file->_dbuf, cip->fsize);
3792 3792                  return (-1);
3793 3793          }
3794 3794          file->_base = kobj_alloc(hdr->ch_blksize, KM_WAIT|KM_TMP);
3795 3795          file->_bsize = hdr->ch_blksize;
3796 3796          return (0);
3797 3797  }
3798 3798  
3799 3799  void
3800 3800  kobj_close_file(struct _buf *file)
↓ open down ↓ 868 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX