* 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.
This commit is contained in:
parent
f8aae275a4
commit
ac3003157b
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue