summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/pinfo.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-10-15 07:03:45 +0000
committerChristopher Faylor <me@cgf.cx>2002-10-15 07:03:45 +0000
commitfdb28b5e5f813721add3ba2b261dfe78f3b895cb (patch)
tree8bf842ee31e89bf925b36aaa4c882d77cc3bb544 /winsup/cygwin/pinfo.cc
parent54030e2146f80ba055f4b7efa20467beab1487e9 (diff)
downloadcygnal-fdb28b5e5f813721add3ba2b261dfe78f3b895cb.tar.gz
cygnal-fdb28b5e5f813721add3ba2b261dfe78f3b895cb.tar.bz2
cygnal-fdb28b5e5f813721add3ba2b261dfe78f3b895cb.zip
* child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
(child_info_fork::mount_table): Remove. (child_info_fork::myself_addr): Remove. * fork.cc (fork_child): Don't set either of the above. * dcrt0.cc (dll_crt0_1): Call memory_init as early as possible. * fhandler_console.cc (console_state): Move to shared_info.h. (fhandler_console::get_tty_stuff): Reflect open_shared arg change. * pinfo.cc (myself_addr): Remove definition. (pinfo::init): Get myself address from open_shared. * pinfo.h (myself_addr): Remove declaration. * shared.cc (open_shared): Rework so that known shared memory locations are protected. Take shared memory type as fifth argument. (memory_init): Reflect open_shared arg change. * shared_info.h (shared_locations): New enum. (console_state): Move here. (open_shared): Reflect open_shared arg change in declaration.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 349545440..0ffd00edd 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -27,13 +27,13 @@ details. */
#include <ntdef.h>
#include "ntdll.h"
#include "cygthread.h"
+#include "shared_info.h"
static char NO_COPY pinfo_dummy[sizeof (_pinfo)] = {0};
pinfo NO_COPY myself ((_pinfo *)&pinfo_dummy); // Avoid myself != NULL checks
HANDLE hexec_proc;
-_pinfo NO_COPY *myself_addr;
void __stdcall
pinfo_fixup_after_fork ()
@@ -128,17 +128,13 @@ pinfo::init (pid_t n, DWORD flag, HANDLE in_h)
}
void *mapaddr;
- bool itsme;
if (!(flag & PID_MYSELF))
- {
- mapaddr = NULL;
- itsme = false;
- }
+ mapaddr = NULL;
else
{
flag &= ~PID_MYSELF;
- mapaddr = myself_addr;
- itsme = true;
+ HANDLE hdummy;
+ mapaddr = open_shared (NULL, 0, hdummy, 0, SH_MYSELF);
}
int createit = flag & (PID_IN_USE | PID_EXECED);
@@ -182,8 +178,6 @@ pinfo::init (pid_t n, DWORD flag, HANDLE in_h)
procinfo = (_pinfo *) MapViewOfFileEx (h, FILE_MAP_READ | FILE_MAP_WRITE,
0, 0, 0, mapaddr);
ProtectHandle1 (h, pinfo_shared_handle);
- if (itsme)
- myself_addr = procinfo;
if ((procinfo->process_state & PID_INITIALIZING) && (flag & PID_NOREDIR)
&& cygwin_pid (procinfo->dwProcessId) != procinfo->pid)