[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.22 and 1.23

version 1.22, 2003/10/15 22:33:18 version 1.23, 2004/05/26 18:17:59
Line 55 
Line 55 
 int     disc = TTYDISC;         /* tip normally runs this way */  int     disc = TTYDISC;         /* tip normally runs this way */
 void    intprompt();  void    intprompt();
 void    timeout();  void    timeout();
 void    cleanup();  void    cleanup(int);
 char    PNbuf[256];                     /* This limits the size of a number */  char    PNbuf[256];                     /* This limits the size of a number */
   
 int  int
Line 138 
Line 138 
         (void)signal(SIGQUIT, cleanup);          (void)signal(SIGQUIT, cleanup);
         (void)signal(SIGHUP, cleanup);          (void)signal(SIGHUP, cleanup);
         (void)signal(SIGTERM, cleanup);          (void)signal(SIGTERM, cleanup);
           (void)signal(SIGCHLD, SIG_IGN);
   
         if ((i = hunt(system)) == 0) {          if ((i = hunt(system)) == 0) {
                 printf("all ports busy\n");                  printf("all ports busy\n");
Line 203 
Line 204 
         i = fcntl(FD, F_GETFL);          i = fcntl(FD, F_GETFL);
         if (i == -1) {          if (i == -1) {
                 perror("fcntl");                  perror("fcntl");
                 cleanup();                  cleanup(0);
         }          }
         i = fcntl(FD, F_SETFL, i & ~O_NONBLOCK);          i = fcntl(FD, F_SETFL, i & ~O_NONBLOCK);
         if (i == -1) {          if (i == -1) {
                 perror("fcntl");                  perror("fcntl");
                 cleanup();                  cleanup(0);
         }          }
   
         tcgetattr(0, &defterm);          tcgetattr(0, &defterm);
Line 236 
Line 237 
          * 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(cumode ? "Connected\r\n" : "\07connected\r\n");
         if ((pid = fork()))          tipin_pid = getpid();
           if ((tipout_pid = fork()))
                 tipin();                  tipin();
         else          else
                 tipout();                  tipout();
Line 245 
Line 247 
 }  }
   
 void  void
 cleanup()  cleanup(int signo)
 {  {
   
         daemon_uid();          daemon_uid();
Line 253 
Line 255 
         if (odisc)          if (odisc)
                 ioctl(0, TIOCSETD, (char *)&odisc);                  ioctl(0, TIOCSETD, (char *)&odisc);
         unraw();          unraw();
           if (signo && tipout_pid) {
                   kill(tipout_pid, signo);
                   wait(NULL);
           }
         exit(0);          exit(0);
 }  }
   

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23