diff options
author | Christopher Faylor <me@cgf.cx> | 2000-08-23 18:56:28 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-08-23 18:56:28 +0400 |
commit | e1cf4ae80c43bd50e0e8f156d61d948d2947d295 (patch) | |
tree | 6ad8ee4a9dc7d7439d949a6531b050f74d00bc83 /winsup/cygwin/pinfo.cc | |
parent | c19e7ba723bb4246a375b41678c2b730718d00e4 (diff) |
Revert previous erroneous checkin.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r-- | winsup/cygwin/pinfo.cc | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 0d52ec9f9..347015be4 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -30,17 +30,17 @@ static pinfo NO_COPY myself_identity ((_pinfo *)&pinfo_dummy); This is done once when the dll is first loaded. */ void __stdcall -set_myself (pid_t pid, HANDLE h) +set_myself (pid_t pid) { DWORD winpid = GetCurrentProcessId (); if (pid == 1) pid = cygwin_pid (winpid); - myself.init (pid, 1, h); + myself.init (pid, 1); myself->dwProcessId = winpid; myself->process_state |= PID_IN_USE; myself->start_time = time (NULL); /* Register our starting time. */ pid_t myself_cyg_pid = cygwin_pid (myself->dwProcessId); - if (pid != myself_cyg_pid && parent_alive) + if (pid != myself_cyg_pid) myself_identity.init (myself_cyg_pid, PID_EXECED); char buf[30]; @@ -95,7 +95,7 @@ pinfo_init (LPBYTE info) { /* Invent our own pid. */ - set_myself (1, NULL); + set_myself (1); myself->ppid = 1; myself->pgid = myself->sid = myself->pid; myself->ctty = -1; @@ -197,7 +197,7 @@ _pinfo::record_death () } void -pinfo::init (pid_t n, DWORD create, HANDLE in_h) +pinfo::init (pid_t n, DWORD create) { if (n == myself->pid) { @@ -217,12 +217,7 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h) else mapsize = sizeof (_pinfo); - if (in_h) - { - h = in_h; - created = 0; - } - else if (!create) + if (!create) { /* CGF FIXME -- deal with inheritance after an exec */ h = OpenFileMappingA (FILE_MAP_READ | FILE_MAP_WRITE, FALSE, mapname); @@ -230,7 +225,7 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h) } else { - h = CreateFileMapping ((HANDLE) 0xffffffff, &sec_all_nih, + h = CreateFileMapping ((HANDLE) 0xffffffff, &sec_none_nih, PAGE_READWRITE, 0, mapsize, mapname); created = h && GetLastError () != ERROR_ALREADY_EXISTS; } @@ -243,13 +238,11 @@ pinfo::init (pid_t n, DWORD create, HANDLE in_h) return; } - ProtectHandle1 (h, pinfo_shared_handle); child = (_pinfo *) MapViewOfFile (h, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0); if (child->process_state & PID_EXECED) { pid_t realpid = child->pid; - debug_printf ("execed process windows pid %d, cygwin pid %d", n, realpid); release (); if (realpid == n) api_fatal ("retrieval of execed process info for pid %d failed due to recursion.", n); |