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

Diff for /src/usr.bin/rcs/rcsprog.c between version 1.109 and 1.110

version 1.109, 2006/04/21 07:06:25 version 1.110, 2006/04/21 14:18:26
Line 95 
Line 95 
         time_t mtime;          time_t mtime;
   
         if (stat(filename, &st) == -1) {          if (stat(filename, &st) == -1) {
                 cvs_log(LP_ERRNO, "failed to stat `%s'", filename);                  warn("%s", filename);
                 return (-1);                  return (-1);
         }          }
         mtime = (time_t)st.st_mtimespec.tv_sec;          mtime = (time_t)st.st_mtimespec.tv_sec;
Line 208 
Line 208 
         }          }
   
         if (ret == 0)          if (ret == 0)
                 cvs_log(LP_ERR, "unknown option -%c", opt);                  warnx("unknown option -%c", opt);
         else if (ret == 1)          else if (ret == 1)
                 cvs_log(LP_ERR, "missing argument for option -%c", opt);                  warnx("missing argument for option -%c", opt);
   
         return (ret);          return (ret);
 }  }
Line 352 
Line 352 
         if (stat(rcspath, &st) == -1 && !(flags & RCS_CREATE)) {          if (stat(rcspath, &st) == -1 && !(flags & RCS_CREATE)) {
                 if (strcmp(__progname, "rcsclean") != 0 &&                  if (strcmp(__progname, "rcsclean") != 0 &&
                     strcmp(__progname, "ci") != 0)                      strcmp(__progname, "ci") != 0)
                         cvs_log(LP_ERRNO, "%s", rcspath);                          warn("%s", rcspath);
                 xfree(rcspath);                  xfree(rcspath);
                 return (-1);                  return (-1);
         }          }
Line 374 
Line 374 
         if (new_str == NULL)          if (new_str == NULL)
                 return;                  return;
         if (*str != NULL)          if (*str != NULL)
                 cvs_log(LP_WARN, "redefinition of revision number");                  warnx("redefinition of revision number");
         *str = new_str;          *str = new_str;
 }  }
   
Line 423 
Line 423 
   
         ret = -1;          ret = -1;
         rcs_optind = 1;          rcs_optind = 1;
         cvs_log_init(LD_STD, 0);  
         SLIST_INIT(&rcs_temp_files);          SLIST_INIT(&rcs_temp_files);
   
         cmd_argc = 0;          cmd_argc = 0;
Line 432 
Line 431 
                 ret = rcs_init(rcsinit, cmd_argv + 1,                  ret = rcs_init(rcsinit, cmd_argv + 1,
                     RCS_CMD_MAXARG - 1);                      RCS_CMD_MAXARG - 1);
                 if (ret < 0) {                  if (ret < 0) {
                         cvs_log(LP_ERRNO, "failed to prepend RCSINIT options");                          warnx("failed to prepend RCSINIT options");
                         exit (1);                          exit (1);
                 }                  }
   
Line 526 
Line 525 
                 case 'k':                  case 'k':
                         kflag = rcs_kflag_get(rcs_optarg);                          kflag = rcs_kflag_get(rcs_optarg);
                         if (RCS_KWEXP_INVAL(kflag)) {                          if (RCS_KWEXP_INVAL(kflag)) {
                                 cvs_log(LP_ERR,                                  warnx("invalid keyword substitution "
                                     "invalid keyword substitution mode `%s'",                                      "mode `%s'", rcs_optarg);
                                     rcs_optarg);  
                                 exit(1);                                  exit(1);
                         }                          }
                         break;                          break;
                 case 'L':                  case 'L':
                         if (lkmode == RCS_LOCK_LOOSE)                          if (lkmode == RCS_LOCK_LOOSE)
                                 cvs_log(LP_WARN, "-U overriden by -L");                                  warnx("-U overriden by -L");
                         lkmode = RCS_LOCK_STRICT;                          lkmode = RCS_LOCK_STRICT;
                         break;                          break;
                 case 'l':                  case 'l':
Line 570 
Line 568 
                         break;                          break;
                 case 'U':                  case 'U':
                         if (lkmode == RCS_LOCK_STRICT)                          if (lkmode == RCS_LOCK_STRICT)
                                 cvs_log(LP_WARN, "-L overriden by -U");                                  warnx("-L overriden by -U");
                         lkmode = RCS_LOCK_LOOSE;                          lkmode = RCS_LOCK_LOOSE;
                         break;                          break;
                 case 'u':                  case 'u':
Line 601 
Line 599 
         argv += rcs_optind;          argv += rcs_optind;
   
         if (argc == 0) {          if (argc == 0) {
                 cvs_log(LP_ERR, "no input file");                  warnx("no input file");
                 (usage)();                  (usage)();
                 exit(1);                  exit(1);
         }          }
Line 629 
Line 627 
   
                 if (logstr != NULL) {                  if (logstr != NULL) {
                         if ((logmsg = strchr(logstr, ':')) == NULL) {                          if ((logmsg = strchr(logstr, ':')) == NULL) {
                                 cvs_log(LP_ERR, "missing log message");                                  warnx("missing log message");
                                 rcs_close(file);                                  rcs_close(file);
                                 continue;                                  continue;
                         }                          }
   
                         *logmsg++ = '\0';                          *logmsg++ = '\0';
                         if ((logrev = rcsnum_parse(logstr)) == NULL) {                          if ((logrev = rcsnum_parse(logstr)) == NULL) {
                                 cvs_log(LP_ERR,                                  warnx("'%s' bad revision number", logstr);
                                     "'%s' bad revision number", logstr);  
                                 rcs_close(file);                                  rcs_close(file);
                                 continue;                                  continue;
                         }                          }
   
                         if (rcs_rev_setlog(file, logrev, logmsg) < 0) {                          if (rcs_rev_setlog(file, logrev, logmsg) < 0) {
                                 cvs_log(LP_ERR,                                  warnx("failed to set logmsg for '%s' to '%s'",
                                     "failed to set logmsg for '%s' to '%s'",  
                                     logstr, logmsg);                                      logstr, logmsg);
                                 rcs_close(file);                                  rcs_close(file);
                                 rcsnum_free(logrev);                                  rcsnum_free(logrev);
Line 718 
Line 714 
                                 rev = rcsnum_alloc();                                  rev = rcsnum_alloc();
                                 rcsnum_cpy(file->rf_head, rev, 0);                                  rcsnum_cpy(file->rf_head, rev, 0);
                         } else if ((rev = rcsnum_parse(lrev)) == NULL) {                          } else if ((rev = rcsnum_parse(lrev)) == NULL) {
                                 cvs_log(LP_ERR, "unable to unlock file");                                  warnx("unable to unlock file");
                                 rcs_close(file);                                  rcs_close(file);
                                 continue;                                  continue;
                         }                          }
Line 744 
Line 740 
                                 rev = rcsnum_alloc();                                  rev = rcsnum_alloc();
                                 rcsnum_cpy(file->rf_head, rev, 0);                                  rcsnum_cpy(file->rf_head, rev, 0);
                         } else if ((rev = rcsnum_parse(urev)) == NULL) {                          } else if ((rev = rcsnum_parse(urev)) == NULL) {
                                 cvs_log(LP_ERR, "unable to unlock file");                                  warnx("unable to unlock file");
                                 rcs_close(file);                                  rcs_close(file);
                                 continue;                                  continue;
                         }                          }
Line 755 
Line 751 
                                     fpath, rev_str);                                      fpath, rev_str);
                         if (rcs_lock_remove(file, username, rev) == -1 &&                          if (rcs_lock_remove(file, username, rev) == -1 &&
                             !(rcsflags & QUIET))                              !(rcsflags & QUIET))
                                 cvs_log(LP_ERR,                                  warnx("%s: warning: No locks are set.", fpath);
                                     "%s: warning: No locks are set.", fpath);  
                         rcsnum_free(rev);                          rcsnum_free(rev);
                 }                  }
   
Line 828 
Line 823 
                 if (rcs_sym_remove(file, symname) < 0) {                  if (rcs_sym_remove(file, symname) < 0) {
                         if (rcs_errno == RCS_ERR_NOENT &&                          if (rcs_errno == RCS_ERR_NOENT &&
                             !(rcsflags & RCSPROG_NFLAG))                              !(rcsflags & RCSPROG_NFLAG))
                                 cvs_log(LP_WARN,                                  warnx("can't delete nonexisting symbol %s",
                                     "can't delete nonexisting symbol %s", symname);                                      symname);
                 } else {                  } else {
                         if (rcsflags & RCSPROG_NFLAG)                          if (rcsflags & RCSPROG_NFLAG)
                                 rm = 0;                                  rm = 0;

Legend:
Removed from v.1.109  
changed lines
  Added in v.1.110