/[emacs]/emacs/src/process.c
ViewVC logotype

Diff of /emacs/src/process.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.404 by dak, Sat May 17 20:03:22 2003 UTC revision 1.405 by monnier, Sun May 25 17:43:20 2003 UTC
# Line 1  Line 1 
1  /* Asynchronous subprocess control for GNU Emacs.  /* Asynchronous subprocess control for GNU Emacs.
2     Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 96, 98, 1999,     Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 96, 98, 1999,
3        2001, 2002 Free Software Foundation, Inc.        2001, 2002, 2003 Free Software Foundation, Inc.
4    
5  This file is part of GNU Emacs.  This file is part of GNU Emacs.
6    
# Line 459  status_message (status) Line 459  status_message (status)
459  int  int
460  allocate_pty ()  allocate_pty ()
461  {  {
   struct stat stb;  
462    register int c, i;    register int c, i;
463    int fd;    int fd;
464    
   /* Some systems name their pseudoterminals so that there are gaps in  
      the usual sequence - for example, on HP9000/S700 systems, there  
      are no pseudoterminals with names ending in 'f'.  So we wait for  
      three failures in a row before deciding that we've reached the  
      end of the ptys.  */  
   int failed_count = 0;  
   
465  #ifdef PTY_ITERATION  #ifdef PTY_ITERATION
466    PTY_ITERATION    PTY_ITERATION
467  #else  #else
# Line 486  allocate_pty () Line 478  allocate_pty ()
478  #ifdef PTY_OPEN  #ifdef PTY_OPEN
479          PTY_OPEN;          PTY_OPEN;
480  #else /* no PTY_OPEN */  #else /* no PTY_OPEN */
481  #ifdef IRIS          {
482          /* Unusual IRIS code */            struct stat stb;
483          *ptyv = emacs_open ("/dev/ptc", O_RDWR | O_NDELAY, 0);  # ifdef IRIS
484          if (fd < 0)            /* Unusual IRIS code */
485            return -1;            *ptyv = emacs_open ("/dev/ptc", O_RDWR | O_NDELAY, 0);
486          if (fstat (fd, &stb) < 0)            if (fd < 0)
487            return -1;              return -1;
488  #else /* not IRIS */            if (fstat (fd, &stb) < 0)
489          if (stat (pty_name, &stb) < 0)              return -1;
490            {  # else /* not IRIS */
491              failed_count++;            { /* Some systems name their pseudoterminals so that there are gaps in
492              if (failed_count >= 3)                 the usual sequence - for example, on HP9000/S700 systems, there
493                return -1;                 are no pseudoterminals with names ending in 'f'.  So we wait for
494                   three failures in a row before deciding that we've reached the
495                   end of the ptys.  */
496                int failed_count = 0;
497                
498                if (stat (pty_name, &stb) < 0)
499                  {
500                    failed_count++;
501                    if (failed_count >= 3)
502                      return -1;
503                  }
504                else
505                  failed_count = 0;
506            }            }
507          else  #  ifdef O_NONBLOCK
508            failed_count = 0;            fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0);
509  #ifdef O_NONBLOCK  #  else
510          fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0);            fd = emacs_open (pty_name, O_RDWR | O_NDELAY, 0);
511  #else  #  endif
512          fd = emacs_open (pty_name, O_RDWR | O_NDELAY, 0);  # endif /* not IRIS */
513  #endif          }
 #endif /* not IRIS */  
514  #endif /* no PTY_OPEN */  #endif /* no PTY_OPEN */
515    
516          if (fd >= 0)          if (fd >= 0)
# Line 523  allocate_pty () Line 526  allocate_pty ()
526              if (access (pty_name, 6) != 0)              if (access (pty_name, 6) != 0)
527                {                {
528                  emacs_close (fd);                  emacs_close (fd);
529  #if !defined(IRIS) && !defined(__sgi)  # if !defined(IRIS) && !defined(__sgi)
530                  continue;                  continue;
531  #else  # else
532                  return -1;                  return -1;
533  #endif /* IRIS */  # endif /* IRIS */
534                }                }
535  #endif /* not UNIPLUS */  #endif /* not UNIPLUS */
536              setup_pty (fd);              setup_pty (fd);
# Line 2203  conv_lisp_to_sockaddr (family, address, Line 2206  conv_lisp_to_sockaddr (family, address,
2206       int len;       int len;
2207  {  {
2208    register struct Lisp_Vector *p;    register struct Lisp_Vector *p;
2209    register unsigned char *cp;    register unsigned char *cp = NULL;
2210    register int i;    register int i;
2211    
2212    bzero (sa, len);    bzero (sa, len);

Legend:
Removed from v.1.404  
changed lines
  Added in v.1.405

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26