Commit cdaa72c7 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Only reset the Unix current directory on removable devices.

parent 74aa42a5
......@@ -1348,7 +1348,6 @@ void CDECL get_initial_directory( UNICODE_STRING *dir )
MESSAGE("Warning: could not find DOS drive for current working directory '%s', "
"starting in the Windows directory.\n", cwd ? cwd : "" );
free( cwd );
chdir( "/" ); /* avoid locking removable devices */
}
......
......@@ -1466,7 +1466,16 @@ void server_init_process_done(void)
IMAGE_NT_HEADERS *nt = get_exe_nt_header();
void *entry = (char *)peb->ImageBaseAddress + nt->OptionalHeader.AddressOfEntryPoint;
NTSTATUS status;
int suspend;
int suspend, needs_close, unixdir;
if (peb->ProcessParameters->CurrentDirectory.Handle &&
!server_get_unix_fd( peb->ProcessParameters->CurrentDirectory.Handle,
FILE_TRAVERSE, &unixdir, &needs_close, NULL, NULL ))
{
fchdir( unixdir );
if (needs_close) close( unixdir );
}
else chdir( "/" ); /* avoid locking removable devices */
#ifdef __APPLE__
send_server_task_port();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment