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

Diff for /src/usr.bin/cvs/repository.c between version 1.5 and 1.6

version 1.5, 2006/11/10 14:32:44 version 1.6, 2006/11/28 14:49:58
Line 28 
Line 28 
 void  void
 cvs_repository_unlock(const char *repo)  cvs_repository_unlock(const char *repo)
 {  {
         int l;  
         char fpath[MAXPATHLEN];          char fpath[MAXPATHLEN];
   
         cvs_log(LP_TRACE, "cvs_repository_unlock(%s)", repo);          cvs_log(LP_TRACE, "cvs_repository_unlock(%s)", repo);
   
         l = snprintf(fpath, sizeof(fpath), "%s/%s", repo, CVS_LOCK);          if (cvs_path_cat(repo, CVS_LOCK, fpath, sizeof(fpath)) >= sizeof(fpath))
         if (l == -1 || l >= (int)sizeof(fpath))                  fatal("cvs_repository_unlock: truncation");
                 fatal("cvs_repository_unlock: overflow");  
   
         /* XXX - this ok? */          /* XXX - this ok? */
         cvs_worklist_run(&repo_locks, cvs_worklist_unlink);          cvs_worklist_run(&repo_locks, cvs_worklist_unlink);
Line 44 
Line 42 
 void  void
 cvs_repository_lock(const char *repo)  cvs_repository_lock(const char *repo)
 {  {
         int l, i;          int i;
         struct stat st;          struct stat st;
         char fpath[MAXPATHLEN];          char fpath[MAXPATHLEN];
         struct passwd *pw;          struct passwd *pw;
   
         cvs_log(LP_TRACE, "cvs_repository_lock(%s)", repo);          cvs_log(LP_TRACE, "cvs_repository_lock(%s)", repo);
   
         l = snprintf(fpath, sizeof(fpath), "%s/%s", repo, CVS_LOCK);          if (cvs_path_cat(repo, CVS_LOCK, fpath, sizeof(fpath)) >= sizeof(fpath))
         if (l == -1 || l >= (int)sizeof(fpath))                  fatal("cvs_repository_unlock: truncation");
                 fatal("cvs_repository_lock: overflow");  
   
         for (i = 0; i < CVS_LOCK_TRIES; i++) {          for (i = 0; i < CVS_LOCK_TRIES; i++) {
                 if (cvs_quit)                  if (cvs_quit)
Line 89 
Line 86 
 cvs_repository_getdir(const char *dir, const char *wdir,  cvs_repository_getdir(const char *dir, const char *wdir,
         struct cvs_flisthead *fl, struct cvs_flisthead *dl, int dodirs)          struct cvs_flisthead *fl, struct cvs_flisthead *dl, int dodirs)
 {  {
         int l;  
         DIR *dirp;          DIR *dirp;
         struct dirent *dp;          struct dirent *dp;
         char *s, fpath[MAXPATHLEN];          char *s, fpath[MAXPATHLEN];
Line 110 
Line 106 
                 if (dodirs == 0 && dp->d_type == DT_DIR)                  if (dodirs == 0 && dp->d_type == DT_DIR)
                         continue;                          continue;
   
                 l = snprintf(fpath, sizeof(fpath), "%s/%s", wdir, dp->d_name);                  if (cvs_path_cat(wdir, dp->d_name,
                 if (l == -1 || l >= (int)sizeof(fpath))                      fpath, sizeof(fpath)) >= sizeof(fpath))
                         fatal("cvs_repository_getdir: overflow");                          fatal("cvs_repository_getdir: truncation");
   
                 /*                  /*
                  * Anticipate the file type for sorting, we do not determine                   * Anticipate the file type for sorting, we do not determine

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6