Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-01-19 12:15:17 +0300
committerCorinna Vinschen <corinna@vinschen.de>2011-01-19 12:15:17 +0300
commit808aae3d13971fd7ccb474caff9bd89a9569795b (patch)
treecd8f1261c8db43844af1c02ecc5853daa172ccb6 /winsup/cygwin/exec.cc
parentfc660168bf056b96c6825d3a4ef97b75261577d5 (diff)
* errno.cc (errmap): Add error codes for invalid binaries.
* exec.cc (execvp): Call spawnve with _P_PATH_TYPE_EXEC flag from here. (execvpe): Ditto. * spawn.cc (spawn_guts): Filter _P_PATH_TYPE_EXEC from mode and store in p_type_exec. Call av::fixup with addtional p_type_exec argument. (spawnve): Check for filtered mode. (spawnvpe): Add _P_PATH_TYPE_EXEC flag when calling spawnve. (av::fixup): Accept additional bool parameter p_type_exec. Only check for script if p_type_exec is true. * winf.h (_P_PATH_TYPE_EXEC): Define. (_P_MODE): Define. (av::fixup): Declare with additional bool parameter.
Diffstat (limited to 'winsup/cygwin/exec.cc')
-rw-r--r--winsup/cygwin/exec.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/winsup/cygwin/exec.cc b/winsup/cygwin/exec.cc
index b1fd52783..d4462b534 100644
--- a/winsup/cygwin/exec.cc
+++ b/winsup/cygwin/exec.cc
@@ -1,6 +1,6 @@
/* exec.cc: exec system call support.
- Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2009 Red Hat, Inc.
+ Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2009, 2011 Red Hat, Inc.
This file is part of Cygwin.
@@ -18,6 +18,7 @@ details. */
#include "fhandler.h"
#include "dtable.h"
#include "cygheap.h"
+#include "winf.h"
#undef _execve
/* This is called _execve and not execve because the real execve is defined
@@ -86,14 +87,22 @@ extern "C" int
execvp (const char *path, char * const *argv)
{
path_conv buf;
- return execv (find_exec (path, buf, "PATH=", FE_NNF) ?: "", argv);
+ return spawnve (_P_OVERLAY | _P_PATH_TYPE_EXEC,
+ find_exec (path, buf, "PATH=", FE_NNF) ?: "",
+ argv, cur_environ ());
}
extern "C" int
execvpe (const char *path, char * const *argv, char *const *envp)
{
+ static char *const empty_env[] = { 0 };
+ MALLOC_CHECK;
+ if (!envp)
+ envp = empty_env;
path_conv buf;
- return execve (find_exec (path, buf, "PATH=", FE_NNF) ?: "", argv, envp);
+ return spawnve (_P_OVERLAY | _P_PATH_TYPE_EXEC,
+ find_exec (path, buf, "PATH=", FE_NNF) ?: "",
+ argv, envp);
}
extern "C" int