[BACK]Return to fep_main.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / fep

Diff for /OpenXM_contrib2/fep/fep_main.c between version 1.5 and 1.9

version 1.5, 2005/01/18 14:20:19 version 1.9, 2012/05/14 12:52:08
Line 6  static char rcsid[]=
Line 6  static char rcsid[]=
 #endif /* lint */  #endif /* lint */
   
 #include <stdio.h>  #include <stdio.h>
   #include <stdlib.h>
   #include <string.h>
 #include <signal.h>  #include <signal.h>
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/stat.h>  #include <sys/stat.h>
Line 339  recover_signal ()
Line 341  recover_signal ()
 input_handler()  input_handler()
 {  {
     char   *inputline;      char   *inputline;
     char   *getline ();      char   *mygetline ();
   
     /*      /*
      * Get slave tty descriptor for auto-tty-fix       * Get slave tty descriptor for auto-tty-fix
Line 347  input_handler()
Line 349  input_handler()
     if ((slave = open (slave_tty, O_RDONLY)) < 0)      if ((slave = open (slave_tty, O_RDONLY)) < 0)
         perror ("open");          perror ("open");
   
     while (inputline = getline ()) {      while (inputline = mygetline ()) {
         /*          /*
          * XXX: nbyte should be greater than 0 only for ^@ input in emacs.           * XXX: nbyte should be greater than 0 only for ^@ input in emacs.
          * This solution is very ugly.. but it will takes a half day           * This solution is very ugly.. but it will takes a half day
Line 363  input_handler()
Line 365  input_handler()
   
         /*          /*
          * NOTE:           * NOTE:
          * Saving command line to output buffer is done in getline().           * Saving command line to output buffer is done in mygetline().
          * Because inputline here is converted by alias.           * Because inputline here is converted by alias.
          */           */
   
Line 545  int set_buffer (bp, size)
Line 547  int set_buffer (bp, size)
     BUFFER *bp;      BUFFER *bp;
     int size;      int size;
 {  {
     char *newbuf, *malloc(), *realloc();      char *newbuf;
   
     if (bp->b_buf)      if (bp->b_buf)
         newbuf = (char *) realloc (bp->b_buf, size);          newbuf = (char *) realloc (bp->b_buf, size);
Line 866  get_pty_master()
Line 868  get_pty_master()
         master = 1;          master = 1;
         return;          return;
     }      }
 #ifdef __CYGWIN32__  #if defined(__CYGWIN32__) || defined(__linux__)
     sprintf (master_tty, "/dev/ptmx");      sprintf (master_tty, "/dev/ptmx");
     master = open (master_tty, O_RDWR);      master = open (master_tty, O_RDWR);
     if (master >= 0) {      if (master >= 0) {
   #if defined(__linux__)
           char name[BUFSIZ];
           grantpt(master);
           unlockpt(master);
           if ( !ptsname_r(master,name,sizeof(name)) ) {
               strcpy(slave_tty, name);
               goto FOUND;
           }
   #else
         char *name;          char *name;
         name = (char *)ptsname(master);          name = (char *)ptsname(master);
         if ( name != 0 ) {          if ( name != 0 ) {
             strcpy(slave_tty, name);              strcpy(slave_tty, name);
             goto FOUND;              goto FOUND;
         }          }
   #endif
     }      }
 #else  #else
     for (c = 'p'; c <= 's'; c++) {      for (c = 'p'; c <= 's'; c++) {
Line 1063  usageAndExit()
Line 1075  usageAndExit()
  */   */
 void sigwinch(int dummy)  void sigwinch(int dummy)
 {  {
       char *itoa(int i);
 #ifdef TIOCGWINSZ                       /* 4.3BSD */  #ifdef TIOCGWINSZ                       /* 4.3BSD */
     struct winsize win;      struct winsize win;
   

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>