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>2009-12-21 18:16:28 +0300
committerCorinna Vinschen <corinna@vinschen.de>2009-12-21 18:16:28 +0300
commit6d63272b5312cd145f034ccd573f275d2ea7ecc2 (patch)
tree3810fc0a3e2b3cba2ad8377333de76db72640366 /winsup/cygwin/spawn.cc
parentb2d6e5dfd3641b3cd1ffab814faa5f90b58a34c1 (diff)
* exec.cc (execvp): Call find_exec with FE_NNF flag to enforce
a NULL return when executable isn't found in $PATH. Convert NULL to "". (execvpe): Ditto. * spawn.cc (spawn_guts): Return with EFAULT if prog_arg is NULL. Return with ENOENT if prog_arg is empty string. Add a comment.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 928499614..fdbab76aa 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -281,12 +281,19 @@ spawn_guts (const char *prog_arg, const char *const *argv,
if (prog_arg == NULL)
{
syscall_printf ("prog_arg is NULL");
- set_errno (EINVAL);
+ set_errno (EFAULT); /* As on Linux. */
+ return -1;
+ }
+ if (!prog_arg[0])
+ {
+ syscall_printf ("prog_arg is empty");
+ set_errno (ENOENT); /* Per POSIX */
return -1;
}
syscall_printf ("spawn_guts (%d, %.9500s)", mode, prog_arg);
+ /* FIXME: This is no error condition on Linux. */
if (argv == NULL)
{
syscall_printf ("argv is NULL");