Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-01-29 05:02:03 +0300
committerChristopher Faylor <me@cgf.cx>2002-01-29 05:02:03 +0300
commit494a66d9c5799091ccefcfd2f3d22226b16f4c38 (patch)
treebbcd6f02ad3860e2cfb35b6065c2beec2bfd5e88 /winsup/cygwin/pinfo.cc
parenta489b37643af9b02d8a31b0e584713f90bbd9ba7 (diff)
* external.cc (cygwin_internal): Initialize various internal settings if
required to allow use of some things from user loaded DLL. (CW_STRACE_ON): Add new feature. (CW_CYGWIN_PID_TO_WINPID): Ditto. * pinfo.cc (set_myself): Call "strace.hello" to initiate possible strace session. (pinfo::init): Guard against dereferencing uninitialized myself. * sigproc.cc (wait_sig): Call strace.hello() when __SIGTRACE "signal" received. * strace.cc (strace::hello): New method. * wincap.cc (wincapc::init): Avoid initializing if already initialized. * wincap.h (wincapc::wincapc): New method. * include/sys/cygwin.h: Add new CW_ enums. Kludge typedefs of {g,u}id_t if required. * strace.h (strace::hello): Declare new method.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc27
1 files changed, 4 insertions, 23 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 43e3c5aae..fb6f2fd41 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -62,33 +62,14 @@ set_myself (pid_t pid, HANDLE h)
myself->process_state |= PID_IN_USE;
myself->start_time = time (NULL); /* Register our starting time. */
- char buf[30];
- __small_sprintf (buf, "cYg%8x %x", _STRACE_INTERFACE_ACTIVATE_ADDR,
- &strace.active);
- OutputDebugString (buf);
-
(void) GetModuleFileName (NULL, myself->progname,
sizeof(myself->progname));
- if (strace.active)
- {
- strace.prntf (1, NULL, "**********************************************");
- strace.prntf (1, NULL, "Program name: %s (%d)", myself->progname, myself->pid);
- strace.prntf (1, NULL, "App version: %d.%d, api: %d.%d",
- user_data->dll_major, user_data->dll_minor,
- user_data->api_major, user_data->api_minor);
- strace.prntf (1, NULL, "DLL version: %d.%d, api: %d.%d",
- cygwin_version.dll_major, cygwin_version.dll_minor,
- cygwin_version.api_major, cygwin_version.api_minor);
- strace.prntf (1, NULL, "DLL build: %s", cygwin_version.dll_build_date);
- strace.prntf (1, NULL, "OS version: Windows %s", wincap.osname ());
- strace.prntf (1, NULL, "**********************************************");
- }
-
+ strace.hello ();
return;
}
/* Initialize the process table entry for the current task.
- This is not called for fork'd tasks, only exec'd ones. */
+ This is not called for forked tasks, only execed ones. */
void __stdcall
pinfo_init (char **envp, int envc)
{
@@ -136,7 +117,7 @@ _pinfo::exit (UINT n, bool norecord)
void
pinfo::init (pid_t n, DWORD flag, HANDLE in_h)
{
- if (n == myself->pid)
+ if (myself && n == myself->pid)
{
procinfo = myself;
destroy = 0;
@@ -276,7 +257,7 @@ a cygwin pid.</para>
extern "C" pid_t
cygwin_winpid_to_pid (int winpid)
{
- pinfo p (winpid);
+ pinfo p (cygwin_pid (winpid));
if (p)
return p->pid;