diff options
| author | Eli Zaretskii | 2020-05-30 13:56:20 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2020-05-30 13:56:20 +0300 |
| commit | 360d7c716dc49aeaa62bd2174e803e0a3eaeaa1b (patch) | |
| tree | 798fb661692a146c5f4bf49d339086d648856b6f | |
| parent | f42db4b6e1598c12924cce4bbe4d67e6d86b7963 (diff) | |
| download | emacs-360d7c716dc49aeaa62bd2174e803e0a3eaeaa1b.tar.gz emacs-360d7c716dc49aeaa62bd2174e803e0a3eaeaa1b.zip | |
Remove private prototype for 'execve' and its uses in MinGW build
* src/sysdep.c (emacs_exec_file): Don't compile this function
anymore on WINDOWSNT, since it is not used there. This function
was the only reason for having 'execve' prototype in ms-w32.h.
* nt/inc/ms-w32.h (execve): Remove prototype and the MinGW64 vs
ming.org mess that it causes.
| -rw-r--r-- | nt/inc/ms-w32.h | 11 | ||||
| -rw-r--r-- | src/sysdep.c | 3 |
2 files changed, 3 insertions, 11 deletions
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index cbe35ea1053..4cbae16dc5a 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h | |||
| @@ -300,17 +300,6 @@ extern int sys_umask (int); | |||
| 300 | #define execvp _execvp | 300 | #define execvp _execvp |
| 301 | #include <stdint.h> /* for intptr_t */ | 301 | #include <stdint.h> /* for intptr_t */ |
| 302 | extern intptr_t _execvp (const char *, char **); | 302 | extern intptr_t _execvp (const char *, char **); |
| 303 | #ifdef MINGW_W64 | ||
| 304 | /* GCC 6 has a builtin execve with the prototype shown below. MinGW64 | ||
| 305 | changed the prototype in its process.h to match that, although the | ||
| 306 | library function still calls _execve, which still returns intptr_t. | ||
| 307 | However, using the prototype with intptr_t causes GCC to emit | ||
| 308 | warnings. Fortunately, execve is not used in the MinGW build, but | ||
| 309 | the code that references it is still compiled. */ | ||
| 310 | extern int execve (const char *, char * const *, char * const *); | ||
| 311 | #else | ||
| 312 | extern intptr_t execve (const char *, char * const *, char * const *); | ||
| 313 | #endif | ||
| 314 | #define tcdrain _commit | 303 | #define tcdrain _commit |
| 315 | #define fdopen _fdopen | 304 | #define fdopen _fdopen |
| 316 | #define fsync _commit | 305 | #define fsync _commit |
diff --git a/src/sysdep.c b/src/sysdep.c index 86e7c20cd01..cbd306a6b67 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -199,6 +199,7 @@ maybe_disable_address_randomization (int argc, char **argv) | |||
| 199 | } | 199 | } |
| 200 | #endif | 200 | #endif |
| 201 | 201 | ||
| 202 | #ifndef WINDOWSNT | ||
| 202 | /* Execute the program in FILE, with argument vector ARGV and environ | 203 | /* Execute the program in FILE, with argument vector ARGV and environ |
| 203 | ENVP. Return an error number if unsuccessful. This is like execve | 204 | ENVP. Return an error number if unsuccessful. This is like execve |
| 204 | except it reenables ASLR in the executed program if necessary, and | 205 | except it reenables ASLR in the executed program if necessary, and |
| @@ -215,6 +216,8 @@ emacs_exec_file (char const *file, char *const *argv, char *const *envp) | |||
| 215 | return errno; | 216 | return errno; |
| 216 | } | 217 | } |
| 217 | 218 | ||
| 219 | #endif /* !WINDOWSNT */ | ||
| 220 | |||
| 218 | /* If FD is not already open, arrange for it to be open with FLAGS. */ | 221 | /* If FD is not already open, arrange for it to be open with FLAGS. */ |
| 219 | static void | 222 | static void |
| 220 | force_open (int fd, int flags) | 223 | force_open (int fd, int flags) |