* include/sys/cygwin.h: Rename PID_UNUSED to PID_MAP_RW.
* pinfo.cc (pinfo_init): Initialize myself->gid. (pinfo::init): Create the "access" variable, set it appropriately and use it to specify the requested access. * exceptions.cc (sig_handle_tty_stop): Add PID_MAP_RW in pinfo parent. * signal.cc (kill_worker): Ditto for pinfo dest. * syscalls.cc (setpgid): Ditto for pinfo p.
This commit is contained in:
parent
4442ed9171
commit
276448cf67
|
@ -1,3 +1,13 @@
|
||||||
|
2003-09-13 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
|
* include/sys/cygwin.h: Rename PID_UNUSED to PID_MAP_RW.
|
||||||
|
* pinfo.cc (pinfo_init): Initialize myself->gid.
|
||||||
|
(pinfo::init): Create the "access" variable, set it appropriately and
|
||||||
|
use it to specify the requested access.
|
||||||
|
* exceptions.cc (sig_handle_tty_stop): Add PID_MAP_RW in pinfo parent.
|
||||||
|
* signal.cc (kill_worker): Ditto for pinfo dest.
|
||||||
|
* syscalls.cc (setpgid): Ditto for pinfo p.
|
||||||
|
|
||||||
2003-09-13 Christopher Faylor <cgf@redhat.com>
|
2003-09-13 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* include/cygwin/version.h: Bump DLL minor number to 5.
|
* include/cygwin/version.h: Bump DLL minor number to 5.
|
||||||
|
|
|
@ -614,7 +614,7 @@ sig_handle_tty_stop (int sig)
|
||||||
its list of subprocesses. */
|
its list of subprocesses. */
|
||||||
if (my_parent_is_alive ())
|
if (my_parent_is_alive ())
|
||||||
{
|
{
|
||||||
pinfo parent (myself->ppid);
|
pinfo parent (myself->ppid, PID_MAP_RW);
|
||||||
if (NOTSTATE (parent, PID_NOCLDSTOP))
|
if (NOTSTATE (parent, PID_NOCLDSTOP))
|
||||||
sig_send (parent, SIGCHLD);
|
sig_send (parent, SIGCHLD);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ enum
|
||||||
PID_ORPHANED = 0x0020, /* Member of an orphaned process group. */
|
PID_ORPHANED = 0x0020, /* Member of an orphaned process group. */
|
||||||
PID_ACTIVE = 0x0040, /* Pid accepts signals. */
|
PID_ACTIVE = 0x0040, /* Pid accepts signals. */
|
||||||
PID_CYGPARENT = 0x0080, /* Set if parent was a cygwin app. */
|
PID_CYGPARENT = 0x0080, /* Set if parent was a cygwin app. */
|
||||||
PID_UNUSED = 0x0100, /* ... */
|
PID_MAP_RW = 0x0100, /* Flag to open map rw. */
|
||||||
PID_MYSELF = 0x0200, /* Flag that pid is me. */
|
PID_MYSELF = 0x0200, /* Flag that pid is me. */
|
||||||
PID_NOCLDSTOP = 0x0400, /* Set if no SIGCHLD signal on stop. */
|
PID_NOCLDSTOP = 0x0400, /* Set if no SIGCHLD signal on stop. */
|
||||||
PID_INITIALIZING = 0x0800, /* Set until ready to receive signals. */
|
PID_INITIALIZING = 0x0800, /* Set until ready to receive signals. */
|
||||||
|
|
|
@ -89,7 +89,7 @@ pinfo_init (char **envp, int envc)
|
||||||
myself->pgid = myself->sid = myself->pid;
|
myself->pgid = myself->sid = myself->pid;
|
||||||
myself->ctty = -1;
|
myself->ctty = -1;
|
||||||
myself->uid = ILLEGAL_UID;
|
myself->uid = ILLEGAL_UID;
|
||||||
|
myself->gid = UNKNOWN_GID;
|
||||||
environ_init (NULL, 0); /* call after myself has been set up */
|
environ_init (NULL, 0); /* call after myself has been set up */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,6 +138,8 @@ pinfo::init (pid_t n, DWORD flag, HANDLE in_h)
|
||||||
}
|
}
|
||||||
|
|
||||||
int createit = flag & (PID_IN_USE | PID_EXECED);
|
int createit = flag & (PID_IN_USE | PID_EXECED);
|
||||||
|
DWORD access = FILE_MAP_READ
|
||||||
|
| (flag & (PID_IN_USE | PID_EXECED | PID_MAP_RW) ? FILE_MAP_WRITE : 0);
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
int created;
|
int created;
|
||||||
|
@ -157,7 +159,7 @@ pinfo::init (pid_t n, DWORD flag, HANDLE in_h)
|
||||||
}
|
}
|
||||||
else if (!createit)
|
else if (!createit)
|
||||||
{
|
{
|
||||||
h = OpenFileMappingA (FILE_MAP_READ | FILE_MAP_WRITE, FALSE, mapname);
|
h = OpenFileMappingA (access, FALSE, mapname);
|
||||||
created = 0;
|
created = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -175,8 +177,7 @@ pinfo::init (pid_t n, DWORD flag, HANDLE in_h)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
procinfo = (_pinfo *) MapViewOfFileEx (h, FILE_MAP_READ | FILE_MAP_WRITE,
|
procinfo = (_pinfo *) MapViewOfFileEx (h, access, 0, 0, 0, mapaddr);
|
||||||
0, 0, 0, mapaddr);
|
|
||||||
ProtectHandle1 (h, pinfo_shared_handle);
|
ProtectHandle1 (h, pinfo_shared_handle);
|
||||||
|
|
||||||
if ((procinfo->process_state & PID_INITIALIZING) && (flag & PID_NOREDIR)
|
if ((procinfo->process_state & PID_INITIALIZING) && (flag & PID_NOREDIR)
|
||||||
|
|
|
@ -173,7 +173,7 @@ kill_worker (pid_t pid, int sig)
|
||||||
sig_dispatch_pending ();
|
sig_dispatch_pending ();
|
||||||
|
|
||||||
int res = 0;
|
int res = 0;
|
||||||
pinfo dest (pid);
|
pinfo dest (pid, PID_MAP_RW);
|
||||||
BOOL sendSIGCONT;
|
BOOL sendSIGCONT;
|
||||||
|
|
||||||
if (!dest)
|
if (!dest)
|
||||||
|
|
|
@ -1961,7 +1961,7 @@ setpgid (pid_t pid, pid_t pgid)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pinfo p (pid);
|
pinfo p (pid, PID_MAP_RW);
|
||||||
if (!p)
|
if (!p)
|
||||||
{
|
{
|
||||||
set_errno (ESRCH);
|
set_errno (ESRCH);
|
||||||
|
|
Loading…
Reference in New Issue