Cygwin: pinfo: simplify create_winpid_symlink
The arguments are not used anyway, so drop them. When called, procinfo->dwProcessId is already set right, so we don't have to access myself_initial. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
f5c2d4db5b
commit
d6cf2b781f
|
@ -67,7 +67,7 @@ pinfo::thisproc (HANDLE h)
|
|||
procinfo->dwProcessId = myself_initial.pid;
|
||||
procinfo->sendsig = myself_initial.sendsig;
|
||||
wcscpy (procinfo->progname, myself_initial.progname);
|
||||
create_winpid_symlink (procinfo->pid, procinfo->dwProcessId);
|
||||
create_winpid_symlink ();
|
||||
procinfo->exec_sendsig = NULL;
|
||||
procinfo->exec_dwProcessId = 0;
|
||||
debug_printf ("myself dwProcessId %u", procinfo->dwProcessId);
|
||||
|
@ -303,8 +303,8 @@ cygwin_pid (DWORD dwProcessId)
|
|||
|
||||
/* Create "winpid.WINPID" symlinks with the Cygwin PID of that process as
|
||||
target. This is used to find the Cygwin PID for a given Windows WINPID. */
|
||||
inline void
|
||||
pinfo::create_winpid_symlink (pid_t cygpid, DWORD winpid)
|
||||
void
|
||||
pinfo::create_winpid_symlink ()
|
||||
{
|
||||
WCHAR sym_name[24];
|
||||
WCHAR pid_name[24];
|
||||
|
@ -312,8 +312,7 @@ pinfo::create_winpid_symlink (pid_t cygpid, DWORD winpid)
|
|||
UNICODE_STRING pid_str;
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
|
||||
__small_swprintf (sym_name, L"winpid.%u",
|
||||
procinfo->dwProcessId ?: myself_initial.pid);
|
||||
__small_swprintf (sym_name, L"winpid.%u", procinfo->dwProcessId);
|
||||
RtlInitUnicodeString (&sym_str, sym_name);
|
||||
__small_swprintf (pid_name, L"%u", procinfo->pid);
|
||||
RtlInitUnicodeString (&pid_str, pid_name);
|
||||
|
|
|
@ -163,7 +163,7 @@ public:
|
|||
}
|
||||
pinfo (HANDLE, pinfo_minimal&, pid_t);
|
||||
void __reg2 thisproc (HANDLE);
|
||||
void create_winpid_symlink (pid_t, DWORD);
|
||||
void create_winpid_symlink ();
|
||||
inline void _pinfo_release ();
|
||||
void release ();
|
||||
bool __reg1 wait ();
|
||||
|
|
Loading…
Reference in New Issue