diff options
author | Christopher Faylor <me@cgf.cx> | 2004-05-08 02:55:38 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-05-08 02:55:38 +0000 |
commit | ac3003157b2de7119b72a8bcf4e2e09db51faacc (patch) | |
tree | 296362e0cce3fe15f0f31535a5adb7f07693f174 /winsup/cygwin/syscalls.cc | |
parent | f8aae275a462e1d6c45ba188169ba8d4b408a27f (diff) | |
download | cygnal-ac3003157b2de7119b72a8bcf4e2e09db51faacc.tar.gz cygnal-ac3003157b2de7119b72a8bcf4e2e09db51faacc.tar.bz2 cygnal-ac3003157b2de7119b72a8bcf4e2e09db51faacc.zip |
* 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/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 305d0f0f8..af2974413 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; } |