diff options
| author | Karl Heuer | 1995-05-26 03:21:30 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-05-26 03:21:30 +0000 |
| commit | ecd1f654a11759b1aeb4885e9a6c764ece0c5336 (patch) | |
| tree | b2809209b4ba1ab9e4cdaec2550d06a11469aeff /src | |
| parent | 59d8dc571538cf76925c2d21961a62f7283de284 (diff) | |
| download | emacs-ecd1f654a11759b1aeb4885e9a6c764ece0c5336.tar.gz emacs-ecd1f654a11759b1aeb4885e9a6c764ece0c5336.zip | |
(create_process, send_process): Add volatile qualifiers.
(wait_reading_process_input) [both versions]: Cast args of select.
Diffstat (limited to 'src')
| -rw-r--r-- | src/process.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/process.c b/src/process.c index cedcb38fa8a..55e446ad1d7 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1186,12 +1186,14 @@ create_process (process, new_argv, current_dir) | |||
| 1186 | char **new_argv; | 1186 | char **new_argv; |
| 1187 | Lisp_Object current_dir; | 1187 | Lisp_Object current_dir; |
| 1188 | { | 1188 | { |
| 1189 | int pid, inchannel, outchannel, forkin, forkout; | 1189 | int pid, inchannel, outchannel; |
| 1190 | int sv[2]; | 1190 | int sv[2]; |
| 1191 | #ifdef SIGCHLD | 1191 | #ifdef SIGCHLD |
| 1192 | SIGTYPE (*sigchld)(); | 1192 | SIGTYPE (*sigchld)(); |
| 1193 | #endif | 1193 | #endif |
| 1194 | int pty_flag = 0; | 1194 | /* Use volatile to protect variables from being clobbered by longjmp. */ |
| 1195 | volatile int forkin, forkout; | ||
| 1196 | volatile int pty_flag = 0; | ||
| 1195 | extern char **environ; | 1197 | extern char **environ; |
| 1196 | 1198 | ||
| 1197 | inchannel = outchannel = -1; | 1199 | inchannel = outchannel = -1; |
| @@ -1998,7 +2000,9 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 1998 | { | 2000 | { |
| 1999 | Atemp = input_wait_mask; | 2001 | Atemp = input_wait_mask; |
| 2000 | EMACS_SET_SECS_USECS (timeout, 0, 0); | 2002 | EMACS_SET_SECS_USECS (timeout, 0, 0); |
| 2001 | if (select (MAXDESC, &Atemp, 0, 0, &timeout) <= 0) | 2003 | if ((select (MAXDESC, &Atemp, (SELECT_TYPE *)0, (SELECT_TYPE *)0, |
| 2004 | &timeout) | ||
| 2005 | <= 0)) | ||
| 2002 | { | 2006 | { |
| 2003 | /* It's okay for us to do this and then continue with | 2007 | /* It's okay for us to do this and then continue with |
| 2004 | the loop, since timeout has already been zeroed out. */ | 2008 | the loop, since timeout has already been zeroed out. */ |
| @@ -2043,7 +2047,8 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 2043 | FD_ZERO (&Available); | 2047 | FD_ZERO (&Available); |
| 2044 | } | 2048 | } |
| 2045 | else | 2049 | else |
| 2046 | nfds = select (MAXDESC, &Available, 0, 0, &timeout); | 2050 | nfds = select (MAXDESC, &Available, (SELECT_TYPE *)0, (SELECT_TYPE *)0, |
| 2051 | &timeout); | ||
| 2047 | 2052 | ||
| 2048 | xerrno = errno; | 2053 | xerrno = errno; |
| 2049 | 2054 | ||
| @@ -2476,14 +2481,14 @@ send_process_trap () | |||
| 2476 | OBJECT is the Lisp object that the data comes from. */ | 2481 | OBJECT is the Lisp object that the data comes from. */ |
| 2477 | 2482 | ||
| 2478 | send_process (proc, buf, len, object) | 2483 | send_process (proc, buf, len, object) |
| 2479 | Lisp_Object proc; | 2484 | volatile Lisp_Object proc; |
| 2480 | char *buf; | 2485 | char *buf; |
| 2481 | int len; | 2486 | int len; |
| 2482 | Lisp_Object object; | 2487 | Lisp_Object object; |
| 2483 | { | 2488 | { |
| 2484 | /* Don't use register vars; longjmp can lose them. */ | 2489 | /* Use volatile to protect variables from being clobbered by longjmp. */ |
| 2485 | int rv; | 2490 | int rv; |
| 2486 | unsigned char *procname = XSTRING (XPROCESS (proc)->name)->data; | 2491 | volatile unsigned char *procname = XSTRING (XPROCESS (proc)->name)->data; |
| 2487 | 2492 | ||
| 2488 | #ifdef VMS | 2493 | #ifdef VMS |
| 2489 | struct Lisp_Process *p = XPROCESS (proc); | 2494 | struct Lisp_Process *p = XPROCESS (proc); |
| @@ -3756,7 +3761,8 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 3756 | if (XINT (read_kbd) && detect_input_pending ()) | 3761 | if (XINT (read_kbd) && detect_input_pending ()) |
| 3757 | nfds = 0; | 3762 | nfds = 0; |
| 3758 | else | 3763 | else |
| 3759 | nfds = select (1, &waitchannels, 0, 0, timeout_p); | 3764 | nfds = select (1, &waitchannels, (SELECT_TYPE *)0, (SELECT_TYPE *)0, |
| 3765 | timeout_p); | ||
| 3760 | 3766 | ||
| 3761 | /* Make C-g and alarm signals set flags again */ | 3767 | /* Make C-g and alarm signals set flags again */ |
| 3762 | clear_waiting_for_input (); | 3768 | clear_waiting_for_input (); |