[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.58 and 1.59

version 1.58, 2007/01/03 22:28:30 version 1.59, 2007/01/03 22:56:54
Line 24 
Line 24 
 extern char *__progname;  extern char *__progname;
   
 void            cvs_remove_local(struct cvs_file *);  void            cvs_remove_local(struct cvs_file *);
   void            cvs_remove_force(struct cvs_file *);
   
 static int      force_remove = 0;  static int      force_remove = 0;
 static int      removed = 0;  static int      removed = 0;
Line 68 
Line 69 
   
         cr.enterdir = NULL;          cr.enterdir = NULL;
         cr.leavedir = NULL;          cr.leavedir = NULL;
           cr.flags = flags;
   
           cr.fileproc = cvs_remove_force;
           if (argc > 0)
                   cvs_file_run(argc, argv, &cr);
           else
                   cvs_file_run(1, &arg, &cr);
   
         if (current_cvsroot->cr_method != CVS_METHOD_LOCAL) {          if (current_cvsroot->cr_method != CVS_METHOD_LOCAL) {
                 cr.fileproc = cvs_client_sendfile;                  cr.fileproc = cvs_client_sendfile;
   
Line 78 
Line 86 
                 cr.fileproc = cvs_remove_local;                  cr.fileproc = cvs_remove_local;
         }          }
   
         cr.flags = flags;  
   
         if (argc > 0)          if (argc > 0)
                 cvs_file_run(argc, argv, &cr);                  cvs_file_run(argc, argv, &cr);
         else          else
Line 111 
Line 117 
 }  }
   
 void  void
   cvs_remove_force(struct cvs_file *cf)
   {
           if (cf->file_type != CVS_DIR) {
                   if (force_remove == 1 && cvs_noexec == 0) {
                           if (unlink(cf->file_path) == -1)
                                   fatal("cvs_remove_force: %s", strerror(errno));
                           (void)close(cf->fd);
                           cf->fd = -1;
                   }
           }
   }
   
   void
 cvs_remove_local(struct cvs_file *cf)  cvs_remove_local(struct cvs_file *cf)
 {  {
         int l;          int l;
Line 132 
Line 151 
                         cvs_log(LP_NOTICE, "nothing known about '%s'",                          cvs_log(LP_NOTICE, "nothing known about '%s'",
                             cf->file_path);                              cf->file_path);
                 return;                  return;
         }  
   
         if (force_remove == 1 && cvs_noexec == 0) {  
                 if (unlink(cf->file_path) == -1)  
                         fatal("cvs_remove_local: %s", strerror(errno));  
                 (void)close(cf->fd);  
                 cf->fd = -1;  
         }          }
   
         if (cf->fd != -1) {          if (cf->fd != -1) {

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.59