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

Diff for /src/usr.bin/cvs/buf.c between version 1.31 and 1.32

version 1.31, 2006/01/16 21:02:36 version 1.32, 2006/01/29 17:50:08
Line 375 
Line 375 
 cvs_buf_write(BUF *b, const char *path, mode_t mode)  cvs_buf_write(BUF *b, const char *path, mode_t mode)
 {  {
         int fd;          int fd;
    open:
         if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)) == -1)          if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)) == -1) {
                 fatal("open: `%s': %s", path, strerror(errno));                  if ((errno == EACCES) && (unlink(path) != -1))
                           goto open;
                   else
                           fatal("open: `%s': %s", path, strerror(errno));
           }
   
         if (cvs_buf_write_fd(b, fd) == -1) {          if (cvs_buf_write_fd(b, fd) == -1) {
                 (void)unlink(path);                  (void)unlink(path);

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32