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

Diff for /src/usr.bin/cvs/init.c between version 1.12 and 1.13

version 1.12, 2005/03/30 17:43:04 version 1.13, 2005/04/03 17:32:50
Line 33 
Line 33 
 #include <stdlib.h>  #include <stdlib.h>
 #include <unistd.h>  #include <unistd.h>
 #include <string.h>  #include <string.h>
 #include <sysexits.h>  
   
 #include "cvs.h"  #include "cvs.h"
 #include "rcs.h"  #include "rcs.h"
Line 80 
Line 79 
  * cvs_init_local()   * cvs_init_local()
  *   *
  * Local handler for the "cvs init" command.   * Local handler for the "cvs init" command.
  * Returns 0 on success, or the appropriate exit status on failure.   * Returns 0 on success, -1 on failure.
  */   */
 int  int
 cvs_init_local(struct cvsroot *root)  cvs_init_local(struct cvsroot *root)
Line 98 
Line 97 
                         if (mkdir(path, cvsroot_files[i].cf_mode) == -1) {                          if (mkdir(path, cvsroot_files[i].cf_mode) == -1) {
                                 cvs_log(LP_ERRNO, "failed to create `%s'",                                  cvs_log(LP_ERRNO, "failed to create `%s'",
                                     path);                                      path);
                                 return (EX_CANTCREAT);                                  return (-1);
                         }                          }
                 } else if (cvsroot_files[i].cf_type == CFT_FILE) {                  } else if (cvsroot_files[i].cf_type == CFT_FILE) {
                         fd = open(path, O_WRONLY|O_CREAT|O_EXCL,                          fd = open(path, O_WRONLY|O_CREAT|O_EXCL,
Line 106 
Line 105 
                         if (fd == -1) {                          if (fd == -1) {
                                 cvs_log(LP_ERRNO, "failed to create `%s'",                                  cvs_log(LP_ERRNO, "failed to create `%s'",
                                     path);                                      path);
                                 return (EX_CANTCREAT);                                  return (-1);
                         }                          }
   
                         (void)close(fd);                          (void)close(fd);
Line 114 
Line 113 
                         strlcat(path, RCS_FILE_EXT, sizeof(path));                          strlcat(path, RCS_FILE_EXT, sizeof(path));
                         rfp = rcs_open(path, RCS_WRITE|RCS_CREATE, 0640);                          rfp = rcs_open(path, RCS_WRITE|RCS_CREATE, 0640);
                         if (rfp == NULL) {                          if (rfp == NULL) {
                                 return (EX_CANTCREAT);                                  return (-1);
                         }                          }
   
                         rcs_close(rfp);                          rcs_close(rfp);

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13