aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorTom Tromey2012-09-04 10:10:06 -0600
committerTom Tromey2012-09-04 10:10:06 -0600
commitbf69f522a9e135f9aa483cedd53e71e915f2bf75 (patch)
tree3f73c47fb863ef87f420de1d30858da821072bd9 /src/process.c
parent303324a9232dbc89369faceb6b3530740d0fc1bd (diff)
parent6ec9a5a7b5efb129807f567709ca858211ed7840 (diff)
downloademacs-bf69f522a9e135f9aa483cedd53e71e915f2bf75.tar.gz
emacs-bf69f522a9e135f9aa483cedd53e71e915f2bf75.zip
merge from trunk
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c47
1 files changed, 18 insertions, 29 deletions
diff --git a/src/process.c b/src/process.c
index fa138027ec1..dbbb23b8627 100644
--- a/src/process.c
+++ b/src/process.c
@@ -116,12 +116,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
116#include "gnutls.h" 116#include "gnutls.h"
117#endif 117#endif
118 118
119#ifdef HAVE_WINDOW_SYSTEM
120#include TERM_HEADER
121#endif /* HAVE_WINDOW_SYSTEM */
122
119#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) 123#if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS)
120#include "xgselect.h" 124#include "xgselect.h"
121#endif 125#endif
122#ifdef HAVE_NS
123#include "nsterm.h"
124#endif
125 126
126/* Work around GCC 4.7.0 bug with strict overflow checking; see 127/* Work around GCC 4.7.0 bug with strict overflow checking; see
127 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>. 128 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>.
@@ -164,16 +165,6 @@ static Lisp_Object QClocal, QCremote, QCcoding;
164static Lisp_Object QCserver, QCnowait, QCnoquery, QCstop; 165static Lisp_Object QCserver, QCnowait, QCnoquery, QCstop;
165static Lisp_Object QCsentinel, QClog, QCoptions, QCplist; 166static Lisp_Object QCsentinel, QClog, QCoptions, QCplist;
166static Lisp_Object Qlast_nonmenu_event; 167static Lisp_Object Qlast_nonmenu_event;
167/* QCfamily is declared and initialized in xfaces.c,
168 QCfilter in keyboard.c. */
169extern Lisp_Object QCfamily, QCfilter;
170
171/* Qexit is declared and initialized in eval.c. */
172
173/* QCfamily is defined in xfaces.c. */
174extern Lisp_Object QCfamily;
175/* QCfilter is defined in keyboard.c. */
176extern Lisp_Object QCfilter;
177 168
178#define NETCONN_P(p) (EQ (XPROCESS (p)->type, Qnetwork)) 169#define NETCONN_P(p) (EQ (XPROCESS (p)->type, Qnetwork))
179#define NETCONN1_P(p) (EQ (p->type, Qnetwork)) 170#define NETCONN1_P(p) (EQ (p->type, Qnetwork))
@@ -5039,15 +5030,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
5039 for (channel = 0; channel <= max_input_desc; ++channel) 5030 for (channel = 0; channel <= max_input_desc; ++channel)
5040 { 5031 {
5041 struct fd_callback_data *d = &fd_callback_info[channel]; 5032 struct fd_callback_data *d = &fd_callback_info[channel];
5042 if (FD_ISSET (channel, &Available) 5033 if (d->func
5043 && d->func != 0 5034 && ((d->flags & FOR_READ
5044 && (d->flags & FOR_READ) != 0) 5035 && FD_ISSET (channel, &Available))
5045 d->func (channel, d->data, 1); 5036 || (d->flags & FOR_WRITE
5046 if (FD_ISSET (channel, &Writeok) 5037 && FD_ISSET (channel, &Writeok))))
5047 && d->func != 0 5038 d->func (channel, d->data);
5048 && (d->flags & FOR_WRITE) != 0) 5039 }
5049 d->func (channel, d->data, 0);
5050 }
5051 5040
5052 for (channel = 0; channel <= max_process_desc; channel++) 5041 for (channel = 0; channel <= max_process_desc; channel++)
5053 { 5042 {
@@ -5361,14 +5350,14 @@ read_process_output (Lisp_Object proc, register int channel)
5361 /* There's no good reason to let process filters change the current 5350 /* There's no good reason to let process filters change the current
5362 buffer, and many callers of accept-process-output, sit-for, and 5351 buffer, and many callers of accept-process-output, sit-for, and
5363 friends don't expect current-buffer to be changed from under them. */ 5352 friends don't expect current-buffer to be changed from under them. */
5364 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 5353 record_unwind_current_buffer ();
5365 5354
5366 /* Read and dispose of the process output. */ 5355 /* Read and dispose of the process output. */
5367 outstream = p->filter; 5356 outstream = p->filter;
5368 if (!NILP (outstream)) 5357 if (!NILP (outstream))
5369 { 5358 {
5370 Lisp_Object text; 5359 Lisp_Object text;
5371 int outer_running_asynch_code = running_asynch_code; 5360 bool outer_running_asynch_code = running_asynch_code;
5372 int waiting = waiting_for_user_input_p; 5361 int waiting = waiting_for_user_input_p;
5373 5362
5374 /* No need to gcpro these, because all we do with them later 5363 /* No need to gcpro these, because all we do with them later
@@ -5605,7 +5594,7 @@ send_process_trap (int ignore)
5605{ 5594{
5606 SIGNAL_THREAD_CHECK (SIGPIPE); 5595 SIGNAL_THREAD_CHECK (SIGPIPE);
5607 sigunblock (sigmask (SIGPIPE)); 5596 sigunblock (sigmask (SIGPIPE));
5608 longjmp (send_process_frame, 1); 5597 _longjmp (send_process_frame, 1);
5609} 5598}
5610 5599
5611/* In send_process, when a write fails temporarily, 5600/* In send_process, when a write fails temporarily,
@@ -5808,7 +5797,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf,
5808 /* 2000-09-21: Emacs 20.7, sparc-sun-solaris-2.6, GCC 2.95.2, 5797 /* 2000-09-21: Emacs 20.7, sparc-sun-solaris-2.6, GCC 2.95.2,
5809 CFLAGS="-g -O": The value of the parameter `proc' is clobbered 5798 CFLAGS="-g -O": The value of the parameter `proc' is clobbered
5810 when returning with longjmp despite being declared volatile. */ 5799 when returning with longjmp despite being declared volatile. */
5811 if (!setjmp (send_process_frame)) 5800 if (!_setjmp (send_process_frame))
5812 { 5801 {
5813 p = XPROCESS (proc); /* Repair any setjmp clobbering. */ 5802 p = XPROCESS (proc); /* Repair any setjmp clobbering. */
5814 process_sent_to = proc; 5803 process_sent_to = proc;
@@ -6725,9 +6714,9 @@ static void
6725exec_sentinel (Lisp_Object proc, Lisp_Object reason) 6714exec_sentinel (Lisp_Object proc, Lisp_Object reason)
6726{ 6715{
6727 Lisp_Object sentinel, odeactivate; 6716 Lisp_Object sentinel, odeactivate;
6728 register struct Lisp_Process *p = XPROCESS (proc); 6717 struct Lisp_Process *p = XPROCESS (proc);
6729 ptrdiff_t count = SPECPDL_INDEX (); 6718 ptrdiff_t count = SPECPDL_INDEX ();
6730 int outer_running_asynch_code = running_asynch_code; 6719 bool outer_running_asynch_code = running_asynch_code;
6731 int waiting = waiting_for_user_input_p; 6720 int waiting = waiting_for_user_input_p;
6732 6721
6733 if (inhibit_sentinels) 6722 if (inhibit_sentinels)
@@ -6745,7 +6734,7 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
6745 /* There's no good reason to let sentinels change the current 6734 /* There's no good reason to let sentinels change the current
6746 buffer, and many callers of accept-process-output, sit-for, and 6735 buffer, and many callers of accept-process-output, sit-for, and
6747 friends don't expect current-buffer to be changed from under them. */ 6736 friends don't expect current-buffer to be changed from under them. */
6748 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 6737 record_unwind_current_buffer ();
6749 6738
6750 sentinel = p->sentinel; 6739 sentinel = p->sentinel;
6751 if (NILP (sentinel)) 6740 if (NILP (sentinel))