diff options
| author | Stefan Monnier | 2010-10-15 17:55:33 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2010-10-15 17:55:33 -0400 |
| commit | 0c747cb143fa227e78f350ac353d703f489209df (patch) | |
| tree | 5b434055c797bd75eaa1e3d9d0773e586d44daee /src/callproc.c | |
| parent | a01a7932080e8a6e7bc8472c58cefabcc2c37df3 (diff) | |
| parent | aa095b2db98ae149737f8de00ee733b1d257ed33 (diff) | |
| download | emacs-0c747cb143fa227e78f350ac353d703f489209df.tar.gz emacs-0c747cb143fa227e78f350ac353d703f489209df.zip | |
Merge from trunk
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 41 |
1 files changed, 6 insertions, 35 deletions
diff --git a/src/callproc.c b/src/callproc.c index 6f70631a484..ee0872b5562 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -24,13 +24,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 24 | #include <errno.h> | 24 | #include <errno.h> |
| 25 | #include <stdio.h> | 25 | #include <stdio.h> |
| 26 | #include <setjmp.h> | 26 | #include <setjmp.h> |
| 27 | |||
| 28 | /* Define SIGCHLD as an alias for SIGCLD. */ | ||
| 29 | |||
| 30 | #if !defined (SIGCHLD) && defined (SIGCLD) | ||
| 31 | #define SIGCHLD SIGCLD | ||
| 32 | #endif /* SIGCLD */ | ||
| 33 | |||
| 34 | #include <sys/types.h> | 27 | #include <sys/types.h> |
| 35 | 28 | ||
| 36 | #ifdef HAVE_UNISTD_H | 29 | #ifdef HAVE_UNISTD_H |
| @@ -38,33 +31,20 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 38 | #endif | 31 | #endif |
| 39 | 32 | ||
| 40 | #include <sys/file.h> | 33 | #include <sys/file.h> |
| 41 | #ifdef HAVE_FCNTL_H | ||
| 42 | #include <fcntl.h> | 34 | #include <fcntl.h> |
| 43 | #endif | ||
| 44 | 35 | ||
| 45 | #ifdef WINDOWSNT | 36 | #ifdef WINDOWSNT |
| 46 | #define NOMINMAX | 37 | #define NOMINMAX |
| 47 | #include <windows.h> | 38 | #include <windows.h> |
| 48 | #include <stdlib.h> /* for proper declaration of environ */ | ||
| 49 | #include <fcntl.h> | ||
| 50 | #include "w32.h" | 39 | #include "w32.h" |
| 51 | #define _P_NOWAIT 1 /* from process.h */ | 40 | #define _P_NOWAIT 1 /* from process.h */ |
| 52 | #endif | 41 | #endif |
| 53 | 42 | ||
| 54 | #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ | 43 | #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ |
| 55 | #include <fcntl.h> | ||
| 56 | #include <sys/stat.h> | 44 | #include <sys/stat.h> |
| 57 | #include <sys/param.h> | 45 | #include <sys/param.h> |
| 58 | #endif /* MSDOS */ | 46 | #endif /* MSDOS */ |
| 59 | 47 | ||
| 60 | #ifndef O_RDONLY | ||
| 61 | #define O_RDONLY 0 | ||
| 62 | #endif | ||
| 63 | |||
| 64 | #ifndef O_WRONLY | ||
| 65 | #define O_WRONLY 1 | ||
| 66 | #endif | ||
| 67 | |||
| 68 | #include "lisp.h" | 48 | #include "lisp.h" |
| 69 | #include "commands.h" | 49 | #include "commands.h" |
| 70 | #include "buffer.h" | 50 | #include "buffer.h" |
| @@ -274,21 +254,16 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 274 | if (!NILP (Vcoding_system_for_write)) | 254 | if (!NILP (Vcoding_system_for_write)) |
| 275 | val = Vcoding_system_for_write; | 255 | val = Vcoding_system_for_write; |
| 276 | else if (! must_encode) | 256 | else if (! must_encode) |
| 277 | val = Qnil; | 257 | val = Qraw_text; |
| 278 | else | 258 | else |
| 279 | { | 259 | { |
| 280 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); | 260 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); |
| 281 | args2[0] = Qcall_process; | 261 | args2[0] = Qcall_process; |
| 282 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; | 262 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; |
| 283 | coding_systems = Ffind_operation_coding_system (nargs + 1, args2); | 263 | coding_systems = Ffind_operation_coding_system (nargs + 1, args2); |
| 284 | if (CONSP (coding_systems)) | 264 | val = CONSP (coding_systems) ? XCDR (coding_systems) : Qnil; |
| 285 | val = XCDR (coding_systems); | ||
| 286 | else if (CONSP (Vdefault_process_coding_system)) | ||
| 287 | val = XCDR (Vdefault_process_coding_system); | ||
| 288 | else | ||
| 289 | val = Qnil; | ||
| 290 | } | 265 | } |
| 291 | val = coding_inherit_eol_type (val, Qnil); | 266 | val = complement_process_encoding_system (val); |
| 292 | setup_coding_system (Fcheck_coding_system (val), &argument_coding); | 267 | setup_coding_system (Fcheck_coding_system (val), &argument_coding); |
| 293 | coding_attrs = CODING_ID_ATTRS (argument_coding.id); | 268 | coding_attrs = CODING_ID_ATTRS (argument_coding.id); |
| 294 | if (NILP (CODING_ATTR_ASCII_COMPAT (coding_attrs))) | 269 | if (NILP (CODING_ATTR_ASCII_COMPAT (coding_attrs))) |
| @@ -932,20 +907,16 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r | |||
| 932 | if (!NILP (Vcoding_system_for_write)) | 907 | if (!NILP (Vcoding_system_for_write)) |
| 933 | val = Vcoding_system_for_write; | 908 | val = Vcoding_system_for_write; |
| 934 | else if (NILP (current_buffer->enable_multibyte_characters)) | 909 | else if (NILP (current_buffer->enable_multibyte_characters)) |
| 935 | val = Qnil; | 910 | val = Qraw_text; |
| 936 | else | 911 | else |
| 937 | { | 912 | { |
| 938 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); | 913 | args2 = (Lisp_Object *) alloca ((nargs + 1) * sizeof *args2); |
| 939 | args2[0] = Qcall_process_region; | 914 | args2[0] = Qcall_process_region; |
| 940 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; | 915 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; |
| 941 | coding_systems = Ffind_operation_coding_system (nargs + 1, args2); | 916 | coding_systems = Ffind_operation_coding_system (nargs + 1, args2); |
| 942 | if (CONSP (coding_systems)) | 917 | val = CONSP (coding_systems) ? XCDR (coding_systems) : Qnil; |
| 943 | val = XCDR (coding_systems); | ||
| 944 | else if (CONSP (Vdefault_process_coding_system)) | ||
| 945 | val = XCDR (Vdefault_process_coding_system); | ||
| 946 | else | ||
| 947 | val = Qnil; | ||
| 948 | } | 918 | } |
| 919 | val = complement_process_encoding_system (val); | ||
| 949 | 920 | ||
| 950 | { | 921 | { |
| 951 | int count1 = SPECPDL_INDEX (); | 922 | int count1 = SPECPDL_INDEX (); |