aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-05-08 02:55:38 +0000
committerChristopher Faylor <me@cgf.cx>2004-05-08 02:55:38 +0000
commitac3003157b2de7119b72a8bcf4e2e09db51faacc (patch)
tree296362e0cce3fe15f0f31535a5adb7f07693f174 /winsup/cygwin
parentf8aae275a462e1d6c45ba188169ba8d4b408a27f (diff)
downloadnewlib-ac3003157b2de7119b72a8bcf4e2e09db51faacc.zip
newlib-ac3003157b2de7119b72a8bcf4e2e09db51faacc.tar.gz
newlib-ac3003157b2de7119b72a8bcf4e2e09db51faacc.tar.bz2
* syscalls.cc: Include environ.h.
(chroot): Set errno in case of path error. Call getwinenv. * environ.cc: Remove the NO_COPY attribute of conv_envvars.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/environ.cc2
-rw-r--r--winsup/cygwin/syscalls.cc16
3 files changed, 14 insertions, 11 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index c8cc30a..325c01f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2004-05-08 Pierre Humblet <pierre.humblet@ieee.org>
+ Christopher Faylor <cgf@timesys.com>
+
+ * syscalls.cc: Include environ.h.
+ (chroot): Set errno in case of path error. Call getwinenv.
+ * environ.cc: Remove the NO_COPY attribute of conv_envvars.
+
2004-05-07 Corinna Vinschen <corinna@vinschen.de>
* fhandler_mem.cc (fhandler_dev_mem::fhandler_dev_mem): Move
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index fd04e1f..749d813 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -54,7 +54,7 @@ static char **lastenviron;
CreateProcess. HOME is here because most shells use it and would be
confused by Windows style path names. */
static int return_MAX_PATH (const char *) {return CYG_MAX_PATH;}
-static NO_COPY win_env conv_envvars[] =
+static win_env conv_envvars[] =
{
{NL ("PATH="), NULL, NULL, cygwin_win32_to_posix_path_list,
cygwin_posix_to_win32_path_list,
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 305d0f0..af29744 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -61,6 +61,7 @@ details. */
#include "pwdgrp.h"
#include "cpuid.h"
#include "registry.h"
+#include "environ.h"
#undef _close
#undef _lseek
@@ -2232,21 +2233,16 @@ chroot (const char *newroot)
{
path_conv path (newroot, PC_SYM_FOLLOW | PC_FULL | PC_POSIX);
- int ret;
+ int ret = -1;
if (path.error)
- ret = -1;
+ set_errno (path.error);
else if (!path.exists ())
- {
- set_errno (ENOENT);
- ret = -1;
- }
+ set_errno (ENOENT);
else if (!path.isdir ())
- {
- set_errno (ENOTDIR);
- ret = -1;
- }
+ set_errno (ENOTDIR);
else
{
+ getwinenv("PATH="); /* Save the native PATH */
cygheap->root.set (path.normalized_path, path);
ret = 0;
}