diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-12-18 20:32:04 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-12-18 20:32:04 +0000 |
commit | f16706de978322fb69a39bae0dd817fb2fdaeaf2 (patch) | |
tree | 057ab687428b320ffe92db406a7767039756e398 /winsup/cygwin/fork.cc | |
parent | 333a47d316455824fb63bf35938a1c8ea870b84b (diff) | |
download | cygnal-f16706de978322fb69a39bae0dd817fb2fdaeaf2.tar.gz cygnal-f16706de978322fb69a39bae0dd817fb2fdaeaf2.tar.bz2 cygnal-f16706de978322fb69a39bae0dd817fb2fdaeaf2.zip |
Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcess
according to context. Throughout, replace hMainThread with
GetCurrentThread/NtCurrentThread according to context.
* dcrt0.cc (dll_crt0_0): Drop duplication of GetCurrentProcess to
hMainProc. Drop duplication of GetCurrentThread to hMainThread.
* dtable.cc (dtable::stdio_init): Remove useless comment.
* globals.cc (hMainProc): Remove.
(hMainThread): Remove.
* ntdll.h (NtCurrentProcess): Define.
(NtCurrentThread: Define.
Diffstat (limited to 'winsup/cygwin/fork.cc')
-rw-r--r-- | winsup/cygwin/fork.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index ea162519f..f0a427a63 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -263,8 +263,9 @@ slow_pid_reuse (HANDLE h) windows from reusing the same pid. */ if (last_fork_procs[nfork_procs]) ForceCloseHandle1 (last_fork_procs[nfork_procs], fork_stupidity); - if (DuplicateHandle (hMainProc, h, hMainProc, &last_fork_procs[nfork_procs], - 0, FALSE, DUPLICATE_SAME_ACCESS)) + if (DuplicateHandle (GetCurrentProcess (), h, + GetCurrentProcess (), &last_fork_procs[nfork_procs], + 0, FALSE, DUPLICATE_SAME_ACCESS)) ProtectHandle1 (last_fork_procs[nfork_procs], fork_stupidity); else { @@ -287,7 +288,7 @@ frok::parent (volatile char * volatile stack_here) pinfo child; static char errbuf[256]; - int c_flags = GetPriorityClass (hMainProc); + int c_flags = GetPriorityClass (GetCurrentProcess ()); debug_printf ("priority class %d", c_flags); /* If we don't have a console, then don't create a console for the |