changeset 11926:40d7e6f04ebe

(create_process, send_process): Add volatile qualifiers. (wait_reading_process_input) [both versions]: Cast args of select.
author Karl Heuer <kwzh@gnu.org>
date Fri, 26 May 1995 03:21:30 +0000
parents 73f8dc6f0622
children 20eae371b3f0
files src/process.c
diffstat 1 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Fri May 26 02:52:36 1995 +0000
+++ b/src/process.c	Fri May 26 03:21:30 1995 +0000
@@ -1186,12 +1186,14 @@
      char **new_argv;
      Lisp_Object current_dir;
 {
-  int pid, inchannel, outchannel, forkin, forkout;
+  int pid, inchannel, outchannel;
   int sv[2];
 #ifdef SIGCHLD
   SIGTYPE (*sigchld)();
 #endif
-  int pty_flag = 0;
+  /* Use volatile to protect variables from being clobbered by longjmp.  */
+  volatile int forkin, forkout;
+  volatile int pty_flag = 0;
   extern char **environ;
 
   inchannel = outchannel = -1;
@@ -1998,7 +2000,9 @@
 	{
 	  Atemp = input_wait_mask;
 	  EMACS_SET_SECS_USECS (timeout, 0, 0);
-	  if (select (MAXDESC, &Atemp, 0, 0, &timeout) <= 0)
+	  if ((select (MAXDESC, &Atemp, (SELECT_TYPE *)0, (SELECT_TYPE *)0,
+		       &timeout)
+	       <= 0))
 	    {
 	      /* It's okay for us to do this and then continue with
 		 the loop, since timeout has already been zeroed out.  */
@@ -2043,7 +2047,8 @@
 	  FD_ZERO (&Available);
 	}
       else
-	nfds = select (MAXDESC, &Available, 0, 0, &timeout);
+	nfds = select (MAXDESC, &Available, (SELECT_TYPE *)0, (SELECT_TYPE *)0,
+		       &timeout);
 
       xerrno = errno;
 
@@ -2476,14 +2481,14 @@
    OBJECT is the Lisp object that the data comes from.  */
 
 send_process (proc, buf, len, object)
-     Lisp_Object proc;
+     volatile Lisp_Object proc;
      char *buf;
      int len;
      Lisp_Object object;
 {
-  /* Don't use register vars; longjmp can lose them.  */
+  /* Use volatile to protect variables from being clobbered by longjmp.  */
   int rv;
-  unsigned char *procname = XSTRING (XPROCESS (proc)->name)->data;
+  volatile unsigned char *procname = XSTRING (XPROCESS (proc)->name)->data;
 
 #ifdef VMS
   struct Lisp_Process *p = XPROCESS (proc);
@@ -3756,7 +3761,8 @@
       if (XINT (read_kbd) && detect_input_pending ())
 	nfds = 0;
       else
-	nfds = select (1, &waitchannels, 0, 0, timeout_p);
+	nfds = select (1, &waitchannels, (SELECT_TYPE *)0, (SELECT_TYPE *)0,
+		       timeout_p);
 
       /* Make C-g and alarm signals set flags again */
       clear_waiting_for_input ();