[BACK]Return to read.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/read.c between version 1.150 and 1.151

version 1.150, 2016/07/19 16:22:52 version 1.151, 2016/07/19 21:31:55
Line 19 
Line 19 
 #include "config.h"  #include "config.h"
   
 #include <sys/types.h>  #include <sys/types.h>
 #if HAVE_MMAP  
 #include <sys/mman.h>  #include <sys/mman.h>
 #include <sys/stat.h>  #include <sys/stat.h>
 #endif  
   
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
Line 598  read_whole_file(struct mparse *curp, const char *file,
Line 596  read_whole_file(struct mparse *curp, const char *file,
         size_t           off;          size_t           off;
         ssize_t          ssz;          ssize_t          ssz;
   
 #if HAVE_MMAP  
         struct stat      st;          struct stat      st;
   
         if (fstat(fd, &st) == -1)          if (fstat(fd, &st) == -1)
Line 622  read_whole_file(struct mparse *curp, const char *file,
Line 619  read_whole_file(struct mparse *curp, const char *file,
                 if (fb->buf != MAP_FAILED)                  if (fb->buf != MAP_FAILED)
                         return 1;                          return 1;
         }          }
 #endif  
   
         if (curp->gzip) {          if (curp->gzip) {
                 if ((gz = gzdopen(fd, "rb")) == NULL)                  if ((gz = gzdopen(fd, "rb")) == NULL)
Line 747  mparse_readfd(struct mparse *curp, int fd, const char 
Line 743  mparse_readfd(struct mparse *curp, int fd, const char 
                     (MPARSE_UTF8 | MPARSE_LATIN1);                      (MPARSE_UTF8 | MPARSE_LATIN1);
                 mparse_parse_buffer(curp, blk, file);                  mparse_parse_buffer(curp, blk, file);
                 curp->filenc = save_filenc;                  curp->filenc = save_filenc;
 #if HAVE_MMAP  
                 if (with_mmap)                  if (with_mmap)
                         munmap(blk.buf, blk.sz);                          munmap(blk.buf, blk.sz);
                 else                  else
 #endif  
                         free(blk.buf);                          free(blk.buf);
         }          }
         return curp->file_status;          return curp->file_status;

Legend:
Removed from v.1.150  
changed lines
  Added in v.1.151

CVSweb