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

Diff for /src/usr.bin/tip/Attic/cu.c between version 1.28 and 1.29

version 1.28, 2010/06/29 21:34:50 version 1.29, 2010/06/29 23:10:56
Line 43 
Line 43 
 void  void
 cumain(int argc, char *argv[])  cumain(int argc, char *argv[])
 {  {
         int ch, i, parity;          int ch, i, parity, baudrate;
         const char *errstr;          const char *errstr;
         static char sbuf[12];          static char sbuf[12];
   
         if (argc < 2)          if (argc < 2)
                 cuusage();                  cuusage();
         DV = NULL;          DV = NULL;
         BR = DEFBR;          setnumber(value(BAUDRATE), DEFBR);
         parity = 0;     /* none */          parity = 0;     /* none */
   
         /*          /*
Line 96 
Line 96 
                                         err(3, "asprintf");                                          err(3, "asprintf");
                         break;                          break;
                 case 's':                  case 's':
                         BR = (int)strtonum(optarg, 0, INT_MAX, &errstr);                          baudrate = (int)strtonum(optarg, 0, INT_MAX, &errstr);
                         if (errstr)                          if (errstr)
                                 errx(3, "speed is %s: %s", errstr, optarg);                                  errx(3, "speed is %s: %s", errstr, optarg);
                           setnumber(value(BAUDRATE), baudrate);
                         break;                          break;
                 case 'h':                  case 'h':
                         setboolean(value(LECHO), 1);                          setboolean(value(LECHO), 1);
                         HD = 1;                          setboolean(value(HALFDUPLEX), 1);
                         break;                          break;
                 case 't':                  case 't':
                         /* Was for a hardwired dial-up connection. */                          /* Was for a hardwired dial-up connection. */
Line 148 
Line 149 
          * The "cu" host name is used to define the           * The "cu" host name is used to define the
          * attributes of the generic dialer.           * attributes of the generic dialer.
          */           */
         (void)snprintf(sbuf, sizeof(sbuf), "cu%ld", BR);          (void)snprintf(sbuf, sizeof(sbuf), "cu%ld", number(value(BAUDRATE)));
         if ((i = hunt(sbuf)) == 0) {          if ((i = hunt(sbuf)) == 0) {
                 printf("all ports busy\n");                  printf("all ports busy\n");
                 exit(3);                  exit(3);
Line 173 
Line 174 
                 break;                  break;
         }          }
         setboolean(value(VERBOSE), 0);          setboolean(value(VERBOSE), 0);
         if (ttysetup(BR)) {          if (ttysetup(number(value(BAUDRATE)))) {
                 fprintf(stderr, "%s: unsupported speed %ld\n",                  fprintf(stderr, "%s: unsupported speed %ld\n",
                     __progname, BR);                      __progname, number(value(BAUDRATE)));
                 (void)uu_unlock(uucplock);                  (void)uu_unlock(uucplock);
                 exit(3);                  exit(3);
         }          }

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29