From 360d7c716dc49aeaa62bd2174e803e0a3eaeaa1b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 30 May 2020 13:56:20 +0300 Subject: [PATCH] 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. --- nt/inc/ms-w32.h | 11 ----------- 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); #define execvp _execvp #include /* for intptr_t */ extern intptr_t _execvp (const char *, char **); -#ifdef MINGW_W64 -/* GCC 6 has a builtin execve with the prototype shown below. MinGW64 - changed the prototype in its process.h to match that, although the - library function still calls _execve, which still returns intptr_t. - However, using the prototype with intptr_t causes GCC to emit - warnings. Fortunately, execve is not used in the MinGW build, but - the code that references it is still compiled. */ -extern int execve (const char *, char * const *, char * const *); -#else -extern intptr_t execve (const char *, char * const *, char * const *); -#endif #define tcdrain _commit #define fdopen _fdopen #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) } #endif +#ifndef WINDOWSNT /* Execute the program in FILE, with argument vector ARGV and environ ENVP. Return an error number if unsuccessful. This is like execve 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) return errno; } +#endif /* !WINDOWSNT */ + /* If FD is not already open, arrange for it to be open with FLAGS. */ static void force_open (int fd, int flags) -- 2.39.5