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

Diff for /src/usr.bin/xinstall/xinstall.c between version 1.51 and 1.52

version 1.51, 2012/04/11 14:19:35 version 1.52, 2012/09/14 00:00:29
Line 235 
Line 235 
                 docompare = 0;                  docompare = 0;
         }          }
   
           if (!devnull) {
                   if ((from_fd = open(from_name, O_RDONLY, 0)) < 0)
                           err(EX_OSERR, "%s", from_name);
           }
   
         if (safecopy) {          if (safecopy) {
                 to_fd = create_tempfile(to_name, tempfile, sizeof(tempfile));                  to_fd = create_tempfile(to_name, tempfile, sizeof(tempfile));
                 if (to_fd < 0)                  if (to_fd < 0)
Line 248 
Line 253 
         }          }
   
         if (!devnull) {          if (!devnull) {
                 if ((from_fd = open(from_name, O_RDONLY, 0)) < 0) {  
                         serrno = errno;  
                         (void)unlink(safecopy ? tempfile : to_name);  
                         errx(EX_OSERR, "%s: %s", from_name, strerror(serrno));  
                 }  
   
                 if (docompare && !safecopy) {                  if (docompare && !safecopy) {
                         files_match = !(compare(from_fd, from_name,                          files_match = !(compare(from_fd, from_name,
                                         (size_t)from_sb.st_size, to_fd,                                          (size_t)from_sb.st_size, to_fd,
Line 643 
Line 642 
         } else          } else
                 (void)unlink(path);                  (void)unlink(path);
   
         return(open(path, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR));          return(open(path, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR));
 }  }
   
 /*  /*

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52