aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorJoakim Verona2012-09-03 17:30:17 +0200
committerJoakim Verona2012-09-03 17:30:17 +0200
commit4a37733c693d59a9b83a3fb2d0c7f9461d149f60 (patch)
treea33402e09342f748baebf0e4f5a1e40538e620f4 /src/process.c
parent5436d1df5e2ba0b4d4f72b03a1cd09b20403654b (diff)
parentdcde497f27945c3ca4ce8c21f655ef6f627acdd2 (diff)
downloademacs-4a37733c693d59a9b83a3fb2d0c7f9461d149f60.tar.gz
emacs-4a37733c693d59a9b83a3fb2d0c7f9461d149f60.zip
upstream
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c46
1 files changed, 16 insertions, 30 deletions
diff --git a/src/process.c b/src/process.c
index ea463cd9187..04b6abe50a7 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))
@@ -1623,9 +1614,6 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1623 /* Use volatile to protect variables from being clobbered by longjmp. */ 1614 /* Use volatile to protect variables from being clobbered by longjmp. */
1624 volatile int forkin, forkout; 1615 volatile int forkin, forkout;
1625 volatile int pty_flag = 0; 1616 volatile int pty_flag = 0;
1626#ifndef USE_CRT_DLL
1627 extern char **environ;
1628#endif
1629 1617
1630 inchannel = outchannel = -1; 1618 inchannel = outchannel = -1;
1631 1619
@@ -4873,15 +4861,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4873 for (channel = 0; channel <= max_input_desc; ++channel) 4861 for (channel = 0; channel <= max_input_desc; ++channel)
4874 { 4862 {
4875 struct fd_callback_data *d = &fd_callback_info[channel]; 4863 struct fd_callback_data *d = &fd_callback_info[channel];
4876 if (FD_ISSET (channel, &Available) 4864 if (d->func
4877 && d->func != 0 4865 && ((d->condition & FOR_READ
4878 && (d->condition & FOR_READ) != 0) 4866 && FD_ISSET (channel, &Available))
4879 d->func (channel, d->data, 1); 4867 || (d->condition & FOR_WRITE
4880 if (FD_ISSET (channel, &write_mask) 4868 && FD_ISSET (channel, &write_mask))))
4881 && d->func != 0 4869 d->func (channel, d->data);
4882 && (d->condition & FOR_WRITE) != 0) 4870 }
4883 d->func (channel, d->data, 0);
4884 }
4885 4871
4886 for (channel = 0; channel <= max_process_desc; channel++) 4872 for (channel = 0; channel <= max_process_desc; channel++)
4887 { 4873 {
@@ -5201,14 +5187,14 @@ read_process_output (Lisp_Object proc, register int channel)
5201 /* There's no good reason to let process filters change the current 5187 /* There's no good reason to let process filters change the current
5202 buffer, and many callers of accept-process-output, sit-for, and 5188 buffer, and many callers of accept-process-output, sit-for, and
5203 friends don't expect current-buffer to be changed from under them. */ 5189 friends don't expect current-buffer to be changed from under them. */
5204 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 5190 record_unwind_current_buffer ();
5205 5191
5206 /* Read and dispose of the process output. */ 5192 /* Read and dispose of the process output. */
5207 outstream = p->filter; 5193 outstream = p->filter;
5208 if (!NILP (outstream)) 5194 if (!NILP (outstream))
5209 { 5195 {
5210 Lisp_Object text; 5196 Lisp_Object text;
5211 int outer_running_asynch_code = running_asynch_code; 5197 bool outer_running_asynch_code = running_asynch_code;
5212 int waiting = waiting_for_user_input_p; 5198 int waiting = waiting_for_user_input_p;
5213 5199
5214 /* No need to gcpro these, because all we do with them later 5200 /* No need to gcpro these, because all we do with them later
@@ -6572,9 +6558,9 @@ static void
6572exec_sentinel (Lisp_Object proc, Lisp_Object reason) 6558exec_sentinel (Lisp_Object proc, Lisp_Object reason)
6573{ 6559{
6574 Lisp_Object sentinel, odeactivate; 6560 Lisp_Object sentinel, odeactivate;
6575 register struct Lisp_Process *p = XPROCESS (proc); 6561 struct Lisp_Process *p = XPROCESS (proc);
6576 ptrdiff_t count = SPECPDL_INDEX (); 6562 ptrdiff_t count = SPECPDL_INDEX ();
6577 int outer_running_asynch_code = running_asynch_code; 6563 bool outer_running_asynch_code = running_asynch_code;
6578 int waiting = waiting_for_user_input_p; 6564 int waiting = waiting_for_user_input_p;
6579 6565
6580 if (inhibit_sentinels) 6566 if (inhibit_sentinels)
@@ -6592,7 +6578,7 @@ exec_sentinel (Lisp_Object proc, Lisp_Object reason)
6592 /* There's no good reason to let sentinels change the current 6578 /* There's no good reason to let sentinels change the current
6593 buffer, and many callers of accept-process-output, sit-for, and 6579 buffer, and many callers of accept-process-output, sit-for, and
6594 friends don't expect current-buffer to be changed from under them. */ 6580 friends don't expect current-buffer to be changed from under them. */
6595 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 6581 record_unwind_current_buffer ();
6596 6582
6597 sentinel = p->sentinel; 6583 sentinel = p->sentinel;
6598 if (NILP (sentinel)) 6584 if (NILP (sentinel))