[BACK]Return to zopen.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / compress

Diff for /src/usr.bin/compress/zopen.c between version 1.19 and 1.20

version 1.19, 2015/01/16 06:40:06 version 1.20, 2015/02/01 11:50:23
Line 278 
Line 278 
                         /* Secondary hash (after G. Knott). */                          /* Secondary hash (after G. Knott). */
                         disp = zs->zs_hsize_reg - i;                          disp = zs->zs_hsize_reg - i;
                         if (i == 0)                          if (i == 0)
                         disp = 1;                                  disp = 1;
 probe:                  if ((i -= disp) < 0)  probe:                  if ((i -= disp) < 0)
                                 i += zs->zs_hsize_reg;                                  i += zs->zs_hsize_reg;
   
Line 738 
Line 738 
 FILE *  FILE *
 zopen(const char *name, const char *mode, int bits)  zopen(const char *name, const char *mode, int bits)
 {  {
           FILE *fp;
         int fd;          int fd;
         void *cookie;          void *cookie;
         if ((fd = open(name, (*mode=='r'? O_RDONLY:O_WRONLY|O_CREAT),          if ((fd = open(name, (*mode=='r'? O_RDONLY:O_WRONLY|O_CREAT),
Line 747 
Line 748 
                 close(fd);                  close(fd);
                 return NULL;                  return NULL;
         }          }
         return funopen(cookie, (*mode == 'r'?zread:NULL),          if ((fp = funopen(cookie, (*mode == 'r'?zread:NULL),
             (*mode == 'w'?zwrite:NULL), NULL, zclose);              (*mode == 'w'?zwrite:NULL), NULL, zclose)) == NULL) {
                   close(fd);
                   free(cookie);
                   return NULL;
           }
           return fp;
 }  }
   
 void *  void *

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20