* external.cc (sync_wincwd): Remove.

(cygwin_internal): Drop CW_SYNC_WINCWD case.
	* globals.cc (ro_u_pipedir): New R/O unicode string.
	* ntdll.h (RtlSetCurrentDirectory_U): Declare.
	* path.cc (cwdstuff::set): Improve comments.  Drop setting Win32 CWD to
	\\?\PIPE\ on init.  Keep Win32 CWD in sync, if possible.  Set to
	\\?\PIPE\ otherwise.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Revert to 230.
	* include/sys/cygwin.h (cygwin_getinfo_types): Remove CW_SYNC_WINCWD.
This commit is contained in:
Corinna Vinschen
2010-08-27 17:58:45 +00:00
parent 95c929196b
commit 1121c57f54
7 changed files with 52 additions and 53 deletions

View File

@ -162,29 +162,6 @@ sync_winenv ()
free (envblock);
}
/* Synchronize Win32 CWD with Cygwin CWD. Return -1 and set errno if
setting the Win32 CWD fails. */
static unsigned long
sync_wincwd ()
{
unsigned long ret = (unsigned long) -1;
/* Lock cwd. We're accessing it directly here. */
cygheap->cwd.cwd_lock.acquire ();
/* First check if the path can work at all. Fortunately we already have
an error code in the cwd, which was stored there for the sake of
spawn_guts. */
if (cygheap->cwd.get_error ())
set_errno (cygheap->cwd.get_error ());
/* Of course, SetCurrentDirectoryW still can fail, for instance, if the
CWD has been removed or renamed in the meantime. */
else if (!SetCurrentDirectoryW (cygheap->cwd.win32.Buffer))
__seterrno ();
else
ret = 0;
cygheap->cwd.cwd_lock.release ();
return ret;
}
/*
* Cygwin-specific wrapper for win32 ExitProcess and TerminateProcess.
* It ensures that the correct exit code, derived from the specified
@ -537,9 +514,6 @@ cygwin_internal (cygwin_getinfo_types t, ...)
res = (uintptr_t) strerror (err);
}
break;
case CW_SYNC_WINCWD:
res = sync_wincwd ();
break;
default:
set_errno (ENOSYS);