[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.8 and 1.9

version 1.8, 2004/12/08 22:22:38 version 1.9, 2005/05/24 07:38:46
Line 37 
Line 37 
 #include <errno.h>  #include <errno.h>
   
 #include "buf.h"  #include "buf.h"
   #include "cvs.h"
 #include "log.h"  #include "log.h"
   
   
Line 412 
Line 413 
 {  {
         int ret, fd;          int ret, fd;
   
           ret = 0;
   
         fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode);          fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode);
         if (fd == -1) {          if (fd == -1) {
                 cvs_log(LP_ERRNO, "failed to open file `%s': %s",                  cvs_log(LP_ERRNO, "failed to open file `%s': %s",
Line 419 
Line 422 
                 return (-1);                  return (-1);
         }          }
   
         ret = cvs_buf_write_fd(b, fd);          if (!cvs_noexec)
                   ret = cvs_buf_write_fd(b, fd);
   
         if (ret == -1) {          if (ret == -1) {
                 cvs_log(LP_ERRNO, "failed to write to file `%s': %s",                  cvs_log(LP_ERRNO, "failed to write to file `%s': %s",
                     path, strerror(errno));                      path, strerror(errno));
Line 443 
Line 448 
 {  {
         int ret, fd;          int ret, fd;
   
           ret = 0;
   
         fd = mkstemp(template);          fd = mkstemp(template);
         if (fd == -1) {          if (fd == -1) {
                 cvs_log(LP_ERRNO, "failed to mkstemp file `%s': %s",                  cvs_log(LP_ERRNO, "failed to mkstemp file `%s': %s",
Line 450 
Line 457 
                 return (-1);                  return (-1);
         }          }
   
         ret = cvs_buf_write_fd(b, fd);          if (!cvs_noexec)
                   ret = cvs_buf_write_fd(b, fd);
   
         if (ret == -1) {          if (ret == -1) {
                 cvs_log(LP_ERRNO, "failed to write to temp file `%s': %s",                  cvs_log(LP_ERRNO, "failed to write to temp file `%s': %s",
                     template, strerror(errno));                      template, strerror(errno));

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9