diff options
| author | Po Lu | 2021-12-10 21:36:59 +0800 |
|---|---|---|
| committer | Po Lu | 2021-12-11 19:49:40 +0800 |
| commit | a37484992651fa6bdee9d5181fb6b096dbf41426 (patch) | |
| tree | 6d8ed65a07f9da3bc7565be1db166b5090c42378 /src/process.c | |
| parent | 5708da48d1c7017b937e0fbfeb7de77bb3ba084e (diff) | |
| download | emacs-a37484992651fa6bdee9d5181fb6b096dbf41426.tar.gz emacs-a37484992651fa6bdee9d5181fb6b096dbf41426.zip | |
Fix the DJGPP port
* config.bat:
* msdos/sed1v2.inp:
* msdos/sed2v2.inp:
* msdos/sed3v2.inp:
* msdos/sedlibmk.inp: Update for Emacs 28.
* msdos/langinfo.h: New file.
* lisp/loadup.el: Use correct path to temacs when dumping on
MS-DOS.
* src/callproc.c (environ) [MSDOS]: New declaration.
(child_setup, emacs_spawn): Update MS-DOS parts for Emacs 28.
* src/fileio.c (Fcopy_file): Don't use copy_file_range on
MS-DOS.
* src/msdos.c (initialize_msdos_display): Add
`defined_color_hook'.
(openat, fchmodat, futimens, utimensat): New functions.
* src/msdos.h (FRAME_X_DISPLAY): New macro.
* src/process.c: Make some more things conditional on
subprocess support.
(PIPECONN_P, PIPECONN1_P) [!subprocesses]: New placeholder
macros.
(Fnum_processors): Return 1 on MSDOS.
(open_channel_for_module): Avoid subprocess specific code
on MSDOS.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/process.c b/src/process.c index 6731f8808f5..75ba191fa10 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -40,7 +40,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 40 | #include <netinet/in.h> | 40 | #include <netinet/in.h> |
| 41 | #include <arpa/inet.h> | 41 | #include <arpa/inet.h> |
| 42 | 42 | ||
| 43 | #endif /* subprocesses */ | 43 | #else |
| 44 | #define PIPECONN_P(p) false | ||
| 45 | #define PIPECONN1_P(p) false | ||
| 46 | #endif | ||
| 44 | 47 | ||
| 45 | #ifdef HAVE_SETRLIMIT | 48 | #ifdef HAVE_SETRLIMIT |
| 46 | # include <sys/resource.h> | 49 | # include <sys/resource.h> |
| @@ -152,6 +155,7 @@ static bool kbd_is_on_hold; | |||
| 152 | when exiting. */ | 155 | when exiting. */ |
| 153 | bool inhibit_sentinels; | 156 | bool inhibit_sentinels; |
| 154 | 157 | ||
| 158 | #ifdef subprocesses | ||
| 155 | union u_sockaddr | 159 | union u_sockaddr |
| 156 | { | 160 | { |
| 157 | struct sockaddr sa; | 161 | struct sockaddr sa; |
| @@ -164,8 +168,6 @@ union u_sockaddr | |||
| 164 | #endif | 168 | #endif |
| 165 | }; | 169 | }; |
| 166 | 170 | ||
| 167 | #ifdef subprocesses | ||
| 168 | |||
| 169 | #ifndef SOCK_CLOEXEC | 171 | #ifndef SOCK_CLOEXEC |
| 170 | # define SOCK_CLOEXEC 0 | 172 | # define SOCK_CLOEXEC 0 |
| 171 | #endif | 173 | #endif |
| @@ -8238,9 +8240,13 @@ If optional argument QUERY is `current', ignore OMP_NUM_THREADS. | |||
| 8238 | If QUERY is `all', also count processors not available. */) | 8240 | If QUERY is `all', also count processors not available. */) |
| 8239 | (Lisp_Object query) | 8241 | (Lisp_Object query) |
| 8240 | { | 8242 | { |
| 8243 | #ifndef MSDOS | ||
| 8241 | return make_uint (num_processors (EQ (query, Qall) ? NPROC_ALL | 8244 | return make_uint (num_processors (EQ (query, Qall) ? NPROC_ALL |
| 8242 | : EQ (query, Qcurrent) ? NPROC_CURRENT | 8245 | : EQ (query, Qcurrent) ? NPROC_CURRENT |
| 8243 | : NPROC_CURRENT_OVERRIDABLE)); | 8246 | : NPROC_CURRENT_OVERRIDABLE)); |
| 8247 | #else | ||
| 8248 | return make_fixnum (1); | ||
| 8249 | #endif | ||
| 8244 | } | 8250 | } |
| 8245 | 8251 | ||
| 8246 | #ifdef subprocesses | 8252 | #ifdef subprocesses |
| @@ -8285,10 +8291,15 @@ open_channel_for_module (Lisp_Object process) | |||
| 8285 | { | 8291 | { |
| 8286 | CHECK_PROCESS (process); | 8292 | CHECK_PROCESS (process); |
| 8287 | CHECK_TYPE (PIPECONN_P (process), Qpipe_process_p, process); | 8293 | CHECK_TYPE (PIPECONN_P (process), Qpipe_process_p, process); |
| 8294 | #ifndef MSDOS | ||
| 8288 | int fd = dup (XPROCESS (process)->open_fd[SUBPROCESS_STDOUT]); | 8295 | int fd = dup (XPROCESS (process)->open_fd[SUBPROCESS_STDOUT]); |
| 8289 | if (fd == -1) | 8296 | if (fd == -1) |
| 8290 | report_file_error ("Cannot duplicate file descriptor", Qnil); | 8297 | report_file_error ("Cannot duplicate file descriptor", Qnil); |
| 8291 | return fd; | 8298 | return fd; |
| 8299 | #else | ||
| 8300 | /* PIPECONN_P returning true shouldn't be possible on MSDOS. */ | ||
| 8301 | emacs_abort (); | ||
| 8302 | #endif | ||
| 8292 | } | 8303 | } |
| 8293 | 8304 | ||
| 8294 | 8305 | ||