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

Diff for /src/usr.bin/cvs/remove.c between version 1.34 and 1.35

version 1.34, 2005/08/12 06:36:14 version 1.35, 2005/08/22 11:17:26
Line 26 
Line 26 
  */   */
   
 #include <sys/types.h>  #include <sys/types.h>
   #include <sys/stat.h>
   
 #include <errno.h>  #include <errno.h>
 #include <fcntl.h>  #include <fcntl.h>
Line 148 
Line 149 
 {  {
         int existing, l, removed;          int existing, l, removed;
         char buf[MAXPATHLEN], fpath[MAXPATHLEN];          char buf[MAXPATHLEN], fpath[MAXPATHLEN];
           CVSENTRIES *entf;
   
         existing = removed = 0;          existing = removed = 0;
           entf = (CVSENTRIES *)cf->cf_entry;
   
         if (cf->cf_type == DT_DIR) {          if (cf->cf_type == DT_DIR) {
                 if (verbosity > 1)                  if (verbosity > 1)
Line 175 
Line 178 
                             cf->cf_name);                              cf->cf_name);
                 return (0);                  return (0);
         } else if (cf->cf_cvstat == CVS_FST_ADDED) {          } else if (cf->cf_cvstat == CVS_FST_ADDED) {
                   if (cvs_ent_remove(entf, cf->cf_name) == -1)
                           return (CVS_EX_FILE);
   
                 /* XXX scratch it from CVS/Entries */  
   
                 l = snprintf(buf, sizeof(buf), "%s/%s%s",                  l = snprintf(buf, sizeof(buf), "%s/%s%s",
                     CVS_PATH_CVSDIR, cf->cf_name, CVS_DESCR_FILE_EXT);                      CVS_PATH_CVSDIR, cf->cf_name, CVS_DESCR_FILE_EXT);
                 if (l == -1 || l >= (int)sizeof(buf)) {                  if (l == -1 || l >= (int)sizeof(buf)) {
Line 185 
Line 188 
                         cvs_log(LP_ERRNO, "%s", buf);                          cvs_log(LP_ERRNO, "%s", buf);
                         return (CVS_EX_DATA);                          return (CVS_EX_DATA);
                 }                  }
   
                 if (cvs_unlink(buf) == -1)                  if (cvs_unlink(buf) == -1)
                         return (CVS_EX_FILE);                          return (CVS_EX_FILE);
   
Line 235 
Line 239 
 static int  static int
 cvs_remove_file(const char *fpath)  cvs_remove_file(const char *fpath)
 {  {
           struct stat st;
   
         /* if -f option is used, physically remove the file */          /* if -f option is used, physically remove the file */
         if (force_remove == 1) {          if (force_remove == 1) {
                 if(cvs_unlink(fpath) == -1)                  if(cvs_unlink(fpath) == -1)
                         return (-1);                          return (-1);
                 nuked++;                  nuked++;
           } else {
                   if ((stat(fpath, &st) == -1) && (errno == ENOENT))
                           nuked++;
         }          }
   
         return (0);          return (0);

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35