emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/sysdep.c [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/sysdep.c [lexbind]
Date: Wed, 08 Dec 2004 18:56:51 -0500

Index: emacs/src/sysdep.c
diff -c emacs/src/sysdep.c:1.235.2.8 emacs/src/sysdep.c:1.235.2.9
*** emacs/src/sysdep.c:1.235.2.8        Sat Sep  4 09:26:26 2004
--- emacs/src/sysdep.c  Wed Dec  8 23:36:24 2004
***************
*** 1,6 ****
  /* Interfaces to system-dependent kernel and library entries.
!    Copyright (C) 1985, 86,87,88,93,94,95,1999,2000,01,2003
!    Free Software Foundation, Inc.
  
  This file is part of GNU Emacs.
  
--- 1,6 ----
  /* Interfaces to system-dependent kernel and library entries.
!    Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001,
!      2003, 2004  Free Software Foundation, Inc.
  
  This file is part of GNU Emacs.
  
***************
*** 2768,2779 ****
    struct sigaction new_action, old_action;
    sigemptyset (&new_action.sa_mask);
    new_action.sa_handler = action;
! #if defined (SA_RESTART) && ! defined (BROKEN_SA_RESTART)
    /* Emacs mostly works better with restartable system services. If this
       flag exists, we probably want to turn it on here.
       However, on some systems this resets the timeout of `select'
       which means that `select' never finishes if it keeps getting signals.
       BROKEN_SA_RESTART is defined on those systems.  */
    new_action.sa_flags = SA_RESTART;
  #else
    new_action.sa_flags = 0;
--- 2768,2783 ----
    struct sigaction new_action, old_action;
    sigemptyset (&new_action.sa_mask);
    new_action.sa_handler = action;
! #if defined (SA_RESTART) && ! defined (BROKEN_SA_RESTART) && 
!defined(SYNC_INPUT)
    /* Emacs mostly works better with restartable system services. If this
       flag exists, we probably want to turn it on here.
       However, on some systems this resets the timeout of `select'
       which means that `select' never finishes if it keeps getting signals.
       BROKEN_SA_RESTART is defined on those systems.  */
+   /* It's not clear why the comment above says "mostly works better".  --Stef
+      When SYNC_INPUT is set, we don't want SA_RESTART because we need to poll
+      for pending input so we need long-running syscalls to be interrupted
+      after a signal that sets the interrupt_input_pending flag.  */
    new_action.sa_flags = SA_RESTART;
  #else
    new_action.sa_flags = 0;
***************
*** 3225,3231 ****
  #endif
  
    while ((rtnval = open (path, oflag, mode)) == -1
!        && (errno == EINTR));
    return (rtnval);
  }
  
--- 3229,3236 ----
  #endif
  
    while ((rtnval = open (path, oflag, mode)) == -1
!        && (errno == EINTR))
!     QUIT;
    return (rtnval);
  }
  
***************
*** 3258,3264 ****
    register int rtnval;
  
    while ((rtnval = read (fildes, buf, nbyte)) == -1
!        && (errno == EINTR));
    return (rtnval);
  }
  
--- 3263,3270 ----
    register int rtnval;
  
    while ((rtnval = read (fildes, buf, nbyte)) == -1
!        && (errno == EINTR))
!     QUIT;
    return (rtnval);
  }
  
***************
*** 3279,3285 ****
        if (rtnval == -1)
        {
          if (errno == EINTR)
!           continue;
          else
            return (bytes_written ? bytes_written : -1);
        }
--- 3285,3299 ----
        if (rtnval == -1)
        {
          if (errno == EINTR)
!           {
! #ifdef SYNC_INPUT
!             /* I originally used `QUIT' but that might causes files to
!                be truncated if you hit C-g in the middle of it.  --Stef  */
!             if (interrupt_input_pending)
!               handle_async_input ();
! #endif
!             continue;
!           }
          else
            return (bytes_written ? bytes_written : -1);
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]