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

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

version 1.5, 2005/05/19 22:07:33 version 1.6, 2005/05/20 20:00:53
Line 145 
Line 145 
         if (l == -1 || l >= (int)sizeof(cdpath)) {          if (l == -1 || l >= (int)sizeof(cdpath)) {
                 errno = ENAMETOOLONG;                  errno = ENAMETOOLONG;
                 cvs_log(LP_ERRNO, "%s", cdpath);                  cvs_log(LP_ERRNO, "%s", cdpath);
                 return (-1);                  return (CVS_EX_DATA);
         }          }
   
         if (cdir->cf_type == DT_DIR) {          if (cdir->cf_type == DT_DIR) {
Line 170 
Line 170 
                         if (chdir(dpath) == -1) {                          if (chdir(dpath) == -1) {
                                 cvs_log(LP_ERRNO, "cannot change to dir `%s'",                                  cvs_log(LP_ERRNO, "cannot change to dir `%s'",
                                     dpath);                                      dpath);
                                 return (-1);                                  return (CVS_EX_FILE);
                         }                          }
   
                         /* construct `cvs update' command */                          /* construct `cvs update' command */
                         l = snprintf(updcmd, sizeof(updcmd), "%s %s %s update",                          l = snprintf(updcmd, sizeof(updcmd), "%s %s %s update",
                             __progname, UPDCMD_FLAGS, root->cr_str);                              __progname, UPDCMD_FLAGS, root->cr_str);
                         if (l == -1 || l >= (int)sizeof(updcmd))                          if (l == -1 || l >= (int)sizeof(updcmd))
                                 return (-1);                                  return (CVS_EX_DATA);
   
                         /* XXX we should try to avoid a new connection ... */                          /* XXX we should try to avoid a new connection ... */
                         if ((fp = popen(updcmd, "r")) == NULL) {                          if ((fp = popen(updcmd, "r")) == NULL) {
                                 cvs_log(LP_ERROR, "cannot run command `%s'",                                  cvs_log(LP_ERROR, "cannot run command `%s'",
                                     updcmd);                                      updcmd);
                                 return (-1);                                  return (CVS_EX_DATA);
                         }                          }
   
                         while (fgets(buf, sizeof(buf), fp) != NULL) {                          while (fgets(buf, sizeof(buf), fp) != NULL) {
Line 195 
Line 195 
                         if (pclose(fp) != 0) {                          if (pclose(fp) != 0) {
                                 cvs_log(LP_ERROR, "unable to release `%s'",                                  cvs_log(LP_ERROR, "unable to release `%s'",
                                     dpath);                                      dpath);
                                 return (-1);                                  return (CVS_EX_DATA);
                         }                          }
   
                         printf("You have [%d] altered file%s in this "                          printf("You have [%d] altered file%s in this "
Line 216 
Line 216 
                         if (chdir(wdir) == -1) {                          if (chdir(wdir) == -1) {
                                 cvs_log(LP_ERRNO, "cannot change to original "                                  cvs_log(LP_ERRNO, "cannot change to original "
                                     "working dir `%s'", wdir);                                      "working dir `%s'", wdir);
                                 return (-1);                                  return (CVS_EX_FILE);
                         }                          }
   
                         if (dflag == 1) {                          if (dflag == 1) {
Line 224 
Line 224 
                                         cvs_log(LP_ERRNO,                                          cvs_log(LP_ERRNO,
                                             "deletion of directory `%s' failed",                                              "deletion of directory `%s' failed",
                                             dpath);                                              dpath);
                                         return (-1);                                          return (CVS_EX_FILE);
                                 }                                  }
                         }                          }
                 }                  }
         } else {          } else {
                 cvs_log(LP_ERR, "no such directory: %s", dpath);                  cvs_log(LP_ERR, "no such directory: %s", dpath);
                 return (-1);                  return (CVS_EX_DATA);
         }          }
   
         return (0);          return (0);

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