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

Diff for /src/usr.bin/tip/Attic/tip.c between version 1.54 and 1.55

version 1.54, 2012/12/04 19:31:17 version 1.55, 2015/02/07 10:07:15
Line 33 
Line 33 
 /*  /*
  * tip - UNIX link to other systems   * tip - UNIX link to other systems
  *  tip [-v] [-speed] system-name   *  tip [-v] [-speed] system-name
  * or  
  *  cu phone-number [-s speed] [-l line]  
  */   */
   
 #include <sys/types.h>  #include <sys/types.h>
Line 59 
Line 57 
         /* XXX preserve previous braindamaged behavior */          /* XXX preserve previous braindamaged behavior */
         vsetnum(DC, 1);          vsetnum(DC, 1);
   
         if (strcmp(__progname, "cu") == 0) {  
                 cumode = 1;  
                 cumain(argc, argv);  
                 goto cucommon;  
         }  
   
         if (argc > 4) {          if (argc > 4) {
                 fprintf(stderr, "usage: tip [-nv] [-speed] [system-name]\n");                  fprintf(stderr, "usage: tip [-nv] [-speed] [system-name]\n");
                 exit(1);                  exit(1);
Line 119 
Line 111 
         }          }
         con();          con();
   
 cucommon:  
         /*  
          * From here down the code is shared with  
          * the "cu" version of tip.  
          */  
   
         i = fcntl(FD, F_GETFL);          i = fcntl(FD, F_GETFL);
         if (i == -1) {          if (i == -1) {
                 perror("fcntl");                  perror("fcntl");
Line 169 
Line 155 
          *      internal data structures (variables)           *      internal data structures (variables)
          * so, fork one process for local side and one for remote.           * so, fork one process for local side and one for remote.
          */           */
         printf(cumode ? "Connected\r\n" : "\07connected\r\n");          printf("\07connected\r\n");
         tipin_pid = getpid();          tipin_pid = getpid();
         switch (tipout_pid = fork()) {          switch (tipout_pid = fork()) {
         case -1:          case -1:
Line 305 
Line 291 
                                 if (!(gch = escape()))                                  if (!(gch = escape()))
                                         continue;                                          continue;
                         }                          }
                 } else if (!cumode && gch == vgetnum(RAISECHAR)) {                  } else if (gch == vgetnum(RAISECHAR)) {
                         vsetnum(RAISE, !vgetnum(RAISE));                          vsetnum(RAISE, !vgetnum(RAISE));
                         continue;                          continue;
                 } else if (gch == '\r') {                  } else if (gch == '\r') {
Line 315 
Line 301 
                         if (vgetnum(HALFDUPLEX))                          if (vgetnum(HALFDUPLEX))
                                 printf("\r\n");                                  printf("\r\n");
                         continue;                          continue;
                 } else if (!cumode && gch == vgetnum(FORCE)) {                  } else if (gch == vgetnum(FORCE)) {
                         gch = getchar();                          gch = getchar();
                         if (gch == EOF)                          if (gch == EOF)
                                 cleanup(0);                                  cleanup(0);

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55