[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.275 and 1.276

version 1.275, 2021/10/24 21:24:16 version 1.276, 2023/08/11 04:48:14
Line 1068 
Line 1068 
 cvs_file_copy(const char *from, const char *to)  cvs_file_copy(const char *from, const char *to)
 {  {
         struct stat st;          struct stat st;
         struct timeval tv[2];          struct timespec ts[2];
         time_t atime, mtime;  
         int src, dst, ret;          int src, dst, ret;
   
         ret = 0;          ret = 0;
Line 1085 
Line 1084 
         if (fstat(src, &st) == -1)          if (fstat(src, &st) == -1)
                 fatal("cvs_file_copy: `%s': %s", from, strerror(errno));                  fatal("cvs_file_copy: `%s': %s", from, strerror(errno));
   
         atime = st.st_atimespec.tv_sec;  
         mtime = st.st_mtimespec.tv_sec;  
   
         if (S_ISREG(st.st_mode)) {          if (S_ISREG(st.st_mode)) {
                 char *p;                  char *p;
                 int saved_errno;                  int saved_errno;
Line 1120 
Line 1116 
   
                 (void)munmap(p, st.st_size);                  (void)munmap(p, st.st_size);
   
                 tv[0].tv_sec = atime;                  ts[0] = st.st_atim;
                 tv[1].tv_sec = mtime;                  ts[1] = st.st_mtim;
   
                 if (futimes(dst, tv) == -1) {                  if (futimens(dst, ts) == -1) {
                         saved_errno = errno;                          saved_errno = errno;
                         (void)unlink(to);                          (void)unlink(to);
                         fatal("cvs_file_copy: futimes: %s",                          fatal("cvs_file_copy: futimes: %s",

Legend:
Removed from v.1.275  
changed lines
  Added in v.1.276