]> sourceware.org Git - newlib-cygwin.git/commitdiff
* pinfo.h (pinfo::thisproc): Declare. Rename from set_myself.
authorChristopher Faylor <me@cgf.cx>
Sat, 20 Dec 2008 17:32:31 +0000 (17:32 +0000)
committerChristopher Faylor <me@cgf.cx>
Sat, 20 Dec 2008 17:32:31 +0000 (17:32 +0000)
* pinfo.cc (pinfo::thisproc): Define.  Rename from set_myself.  Set procinfo to
NULL to avoid confusing subsequent init.
(pinfo_init): Accommodate set_myself -> pinfo::thisproc rename.
* dcrt0.cc (child_info_fork::handle_fork): Ditto.
(child_info_spawn::handle_spawn): Ditto.

winsup/cygwin/ChangeLog
winsup/cygwin/dcrt0.cc
winsup/cygwin/pinfo.cc
winsup/cygwin/pinfo.h

index 276b12057ed05cc086470eac6f5ad8fb7372f910..13499c04171b71e3fd533dc561e7836e09805f3e 100644 (file)
@@ -1,3 +1,12 @@
+2008-12-20  Christopher Faylor  <me+cygwin@cgf.cx>
+
+       * pinfo.h (pinfo::thisproc): Declare.  Rename from set_myself.
+       * pinfo.cc (pinfo::thisproc): Define.  Rename from set_myself.  Set
+       procinfo to NULL to avoid confusing subsequent init.
+       (pinfo_init): Accommodate set_myself -> pinfo::thisproc rename.
+       * dcrt0.cc (child_info_fork::handle_fork): Ditto.
+       (child_info_spawn::handle_spawn): Ditto.
+
 2008-12-20  Corinna Vinschen  <corinna@vinschen.de>
 
        * pwdgrp.h (pwdgrp::refresh): Fix indentation.
index ccdedc6c07aa7bf336b1b50c16ac74f06ff0ca12..961e60567d4918480bbfc9cd37fbbf7b14e68bb7 100644 (file)
@@ -626,7 +626,7 @@ child_info_fork::handle_fork ()
 {
   cygheap_fixup_in_child (false);
   memory_init ();
-  set_myself (NULL);
+  myself.thisproc (NULL);
   myself->uid = cygheap->user.real_uid;
   myself->gid = cygheap->user.real_gid;
 
@@ -657,7 +657,7 @@ child_info_spawn::handle_spawn ()
       !DuplicateHandle (hMainProc, moreinfo->myself_pinfo, hMainProc, &h, 0,
                        FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
     h = NULL;
-  set_myself (h);
+  myself.thisproc (h);
   __argc = moreinfo->argc;
   __argv = moreinfo->argv;
   envp = moreinfo->envp;
index d5b3bc09d3eff9643f5ca85816ac826bb18ffc95..fd555c918df43a01b9ddb7961167ec8c04bf2249 100644 (file)
@@ -52,28 +52,30 @@ bool is_toplevel_proc;
    _pinfo for this "pid" if h != NULL. */
 
 void __stdcall
-set_myself (HANDLE h)
+pinfo::thisproc (HANDLE h)
 {
+  procinfo = NULL;
+
   if (!h)
     cygheap->pid = cygwin_pid (myself_initial.pid);
 
-  myself.init (cygheap->pid, PID_IN_USE, h ?: INVALID_HANDLE_VALUE);
-  myself->process_state |= PID_IN_USE;
-  myself->dwProcessId = myself_initial.pid;
-  strcpy (myself->progname, myself_initial.progname);
+  init (cygheap->pid, PID_IN_USE, h ?: INVALID_HANDLE_VALUE);
+  procinfo->process_state |= PID_IN_USE;
+  procinfo->dwProcessId = myself_initial.pid;
+  strcpy (procinfo->progname, myself_initial.progname);
   strace.hello ();
-  debug_printf ("myself->dwProcessId %u", myself->dwProcessId);
+  debug_printf ("myself->dwProcessId %u", procinfo->dwProcessId);
   if (h)
     {
       /* here if execed */
       static pinfo NO_COPY myself_identity;
-      myself_identity.init (cygwin_pid (myself->dwProcessId), PID_EXECED, NULL);
-      myself->exec_sendsig = NULL;
-      myself->exec_dwProcessId = 0;
+      myself_identity.init (cygwin_pid (procinfo->dwProcessId), PID_EXECED, NULL);
+      procinfo->exec_sendsig = NULL;
+      procinfo->exec_dwProcessId = 0;
     }
   else if (!child_proc_info)   /* child_proc_info is only set when this process
                                   was started by another cygwin process */
-    myself->start_time = time (NULL); /* Register our starting time. */
+    procinfo->start_time = time (NULL); /* Register our starting time. */
   else if (cygheap->pid_handle)
     {
       ForceCloseHandle (cygheap->pid_handle);
@@ -96,7 +98,7 @@ pinfo_init (char **envp, int envc)
     {
       /* Invent our own pid.  */
 
-      set_myself (NULL);
+      myself.thisproc (NULL);
       myself->ppid = 1;
       myself->pgid = myself->sid = myself->pid;
       myself->ctty = -1;
index 4f7f79bf68fe607b3d29ca1db8386e4e0410dbff..5351595e352351477e65bd61b48d30a2c6dd688d 100644 (file)
@@ -112,8 +112,6 @@ public:
   bool __stdcall exists () __attribute__ ((regparm (1)));
   const char *_ctty (char *);
 
-  friend void __stdcall set_myself (HANDLE);
-
   /* signals */
   HANDLE sendsig;
   HANDLE exec_sendsig;
@@ -147,6 +145,7 @@ public:
   pinfo (_pinfo *x): procinfo (x), hProcess (NULL) {}
   pinfo (pid_t n) : rd_proc_pipe (NULL), hProcess (NULL) {init (n, 0, NULL);}
   pinfo (pid_t n, DWORD flag) : rd_proc_pipe (NULL), hProcess (NULL), waiter_ready (0), wait_thread (NULL) {init (n, flag, NULL);}
+  void thisproc (HANDLE) __attribute__ ((regparm (2)));
   void release ();
   int wait () __attribute__ ((regparm (1)));
   ~pinfo ()
@@ -222,7 +221,6 @@ cygwin_pid (pid_t pid)
 }
 
 void __stdcall pinfo_init (char **, int);
-void __stdcall set_myself (HANDLE h);
 extern pinfo myself;
 
 #define _P_VFORK 0
This page took 0.041613 seconds and 5 git commands to generate.