[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 360d7c7: Remove private prototype for 'execve' and its uses in Mi

From: Eli Zaretskii
Subject: master 360d7c7: Remove private prototype for 'execve' and its uses in MinGW build
Date: Sat, 30 May 2020 06:57:29 -0400 (EDT)

branch: master
commit 360d7c716dc49aeaa62bd2174e803e0a3eaeaa1b
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    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 cbe35ea..4cbae16 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 <stdint.h>            /* 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 *);
-extern intptr_t execve (const char *, char * const *, char * const *);
 #define tcdrain _commit
 #define fdopen   _fdopen
 #define fsync    _commit
diff --git a/src/sysdep.c b/src/sysdep.c
index 86e7c20..cbd306a 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -199,6 +199,7 @@ maybe_disable_address_randomization (int argc, char **argv)
+#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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]