aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorPaul Eggert2012-04-21 17:53:32 -0700
committerPaul Eggert2012-04-21 17:53:32 -0700
commitbbd347f5f7e99da1a559dad818b5fa8f59c0901e (patch)
tree77c1fc54c2240b08d2859109d18cac8812a8ffb1 /src/process.c
parente4ecdc9c71af4199129d5dd2db1a32ff6b725fe4 (diff)
parent9ee7d8b93cb143b473e6dffb708e777bc6fe5bd0 (diff)
downloademacs-bbd347f5f7e99da1a559dad818b5fa8f59c0901e.tar.gz
emacs-bbd347f5f7e99da1a559dad818b5fa8f59c0901e.zip
Merge from trunk.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c50
1 files changed, 33 insertions, 17 deletions
diff --git a/src/process.c b/src/process.c
index 9ccc77e1d83..a84dac144d8 100644
--- a/src/process.c
+++ b/src/process.c
@@ -120,6 +120,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
120#include "nsterm.h" 120#include "nsterm.h"
121#endif 121#endif
122 122
123/* Work around GCC 4.7.0 bug with strict overflow checking; see
124 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>.
125 These lines can be removed once the GCC bug is fixed. */
126#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
127# pragma GCC diagnostic ignored "-Wstrict-overflow"
128#endif
129
123Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname, Qtpgid; 130Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname, Qtpgid;
124Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime, Qcstime; 131Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime, Qcstime;
125Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs; 132Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs;
@@ -1066,7 +1073,9 @@ is more appropriate for saving the process buffer.
1066 1073
1067Binding the variable `inherit-process-coding-system' to non-nil before 1074Binding the variable `inherit-process-coding-system' to non-nil before
1068starting the process is an alternative way of setting the inherit flag 1075starting the process is an alternative way of setting the inherit flag
1069for the process which will run. */) 1076for the process which will run.
1077
1078This function returns FLAG. */)
1070 (register Lisp_Object process, Lisp_Object flag) 1079 (register Lisp_Object process, Lisp_Object flag)
1071{ 1080{
1072 CHECK_PROCESS (process); 1081 CHECK_PROCESS (process);
@@ -1079,7 +1088,8 @@ DEFUN ("set-process-query-on-exit-flag",
1079 2, 2, 0, 1088 2, 2, 0,
1080 doc: /* Specify if query is needed for PROCESS when Emacs is exited. 1089 doc: /* Specify if query is needed for PROCESS when Emacs is exited.
1081If the second argument FLAG is non-nil, Emacs will query the user before 1090If the second argument FLAG is non-nil, Emacs will query the user before
1082exiting or killing a buffer if PROCESS is running. */) 1091exiting or killing a buffer if PROCESS is running. This function
1092returns FLAG. */)
1083 (register Lisp_Object process, Lisp_Object flag) 1093 (register Lisp_Object process, Lisp_Object flag)
1084{ 1094{
1085 CHECK_PROCESS (process); 1095 CHECK_PROCESS (process);
@@ -2521,7 +2531,7 @@ could be "COM1", or "\\\\.\\COM10" for ports higher than COM9 (double
2521the backslashes in strings). 2531the backslashes in strings).
2522 2532
2523:speed SPEED -- (mandatory) is handled by `serial-process-configure', 2533:speed SPEED -- (mandatory) is handled by `serial-process-configure',
2524which is called by `make-serial-process'. 2534which this function calls.
2525 2535
2526:name NAME -- NAME is the name of the process. If NAME is not given, 2536:name NAME -- NAME is the name of the process. If NAME is not given,
2527the value of PORT is used. 2537the value of PORT is used.
@@ -2550,13 +2560,12 @@ but you can send outgoing data. The stopped state is cleared by
2550 2560
2551:plist PLIST -- Install PLIST as the initial plist of the process. 2561:plist PLIST -- Install PLIST as the initial plist of the process.
2552 2562
2553:speed
2554:bytesize 2563:bytesize
2555:parity 2564:parity
2556:stopbits 2565:stopbits
2557:flowcontrol 2566:flowcontrol
2558-- These arguments are handled by `serial-process-configure', which is 2567-- This function calls `serial-process-configure' to handle these
2559called by `make-serial-process'. 2568arguments.
2560 2569
2561The original argument list, possibly modified by later configuration, 2570The original argument list, possibly modified by later configuration,
2562is available via the function `process-contact'. 2571is available via the function `process-contact'.
@@ -2790,7 +2799,7 @@ The stopped state is cleared by `continue-process' and set by
2790:filter-multibyte BOOL -- If BOOL is non-nil, strings given to the 2799:filter-multibyte BOOL -- If BOOL is non-nil, strings given to the
2791process filter are multibyte, otherwise they are unibyte. 2800process filter are multibyte, otherwise they are unibyte.
2792If this keyword is not specified, the strings are multibyte if 2801If this keyword is not specified, the strings are multibyte if
2793`default-enable-multibyte-characters' is non-nil. 2802the default value of `enable-multibyte-characters' is non-nil.
2794 2803
2795:sentinel SENTINEL -- Install SENTINEL as the process sentinel. 2804:sentinel SENTINEL -- Install SENTINEL as the process sentinel.
2796 2805
@@ -4877,16 +4886,23 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
4877 It can't hurt. */ 4886 It can't hurt. */
4878 else if (nread == -1 && errno == EIO) 4887 else if (nread == -1 && errno == EIO)
4879 { 4888 {
4880 /* Don't do anything if only a pty, with no associated 4889 struct Lisp_Process *p = XPROCESS (proc);
4881 process (bug#10933). */ 4890
4882 if (XPROCESS (proc)->pid != -2) { 4891 /* Clear the descriptor now, so we only raise the
4883 /* Clear the descriptor now, so we only raise the signal 4892 signal once. */
4884 once. */ 4893 FD_CLR (channel, &input_wait_mask);
4885 FD_CLR (channel, &input_wait_mask); 4894 FD_CLR (channel, &non_keyboard_wait_mask);
4886 FD_CLR (channel, &non_keyboard_wait_mask); 4895
4887 4896 if (p->pid == -2)
4888 kill (getpid (), SIGCHLD); 4897 {
4889 } 4898 /* If the EIO occurs on a pty, sigchld_handler's
4899 wait3() will not find the process object to
4900 delete. Do it here. */
4901 p->tick = ++process_tick;
4902 p->status = Qfailed;
4903 }
4904 else
4905 kill (getpid (), SIGCHLD);
4890 } 4906 }
4891#endif /* HAVE_PTYS */ 4907#endif /* HAVE_PTYS */
4892 /* If we can detect process termination, don't consider the 4908 /* If we can detect process termination, don't consider the