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

Diff for /src/usr.bin/cvs/file.c between version 1.196 and 1.197

version 1.196, 2007/09/09 20:24:06 version 1.197, 2007/09/17 10:07:21
Line 36 
Line 36 
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
   
   #include "atomicio.h"
 #include "cvs.h"  #include "cvs.h"
   
 #define CVS_IGN_STATIC  0x01    /* pattern is static, no need to glob */  #define CVS_IGN_STATIC  0x01    /* pattern is static, no need to glob */
Line 935 
Line 936 
         mtime = st.st_mtimespec.tv_sec;          mtime = st.st_mtimespec.tv_sec;
   
         if (S_ISREG(st.st_mode)) {          if (S_ISREG(st.st_mode)) {
                 size_t sz;                  char *p;
                 ssize_t nw;  
                 char *p, *buf;  
                 int saved_errno;                  int saved_errno;
   
                 if (st.st_size > (off_t)SIZE_MAX) {                  if (st.st_size > (off_t)SIZE_MAX) {
Line 959 
Line 958 
   
                 madvise(p, st.st_size, MADV_SEQUENTIAL);                  madvise(p, st.st_size, MADV_SEQUENTIAL);
   
                 sz = st.st_size;                  if (atomicio(vwrite, dst, p, st.st_size) != st.st_size) {
                 buf = p;                          saved_errno = errno;
                           (void)unlink(to);
                 while (sz > 0) {                          fatal("cvs_file_copy: `%s': %s", from,
                         if ((nw = write(dst, p, sz)) == -1) {                              strerror(saved_errno));
                                 saved_errno = errno;  
                                 (void)unlink(to);  
                                 fatal("cvs_file_copy: `%s': %s",  
                                     from, strerror(saved_errno));  
                         }  
                         buf += nw;  
                         sz -= nw;  
                 }                  }
   
                 (void)munmap(p, st.st_size);                  (void)munmap(p, st.st_size);

Legend:
Removed from v.1.196  
changed lines
  Added in v.1.197