OSDN Git Service

* fhandler_process.cc (fhandler_process::fill_filebuf): Open pinfo with
authorcgf <cgf>
Wed, 17 Sep 2003 02:10:12 +0000 (02:10 +0000)
committercgf <cgf>
Wed, 17 Sep 2003 02:10:12 +0000 (02:10 +0000)
PID_MAP_RW.
* sigproc.cc (talktome): Ditto for winpids.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_process.cc
winsup/cygwin/sigproc.cc

index a7ef9a7..2725400 100644 (file)
@@ -1,5 +1,11 @@
 2003-09-16  Christopher Faylor  <cgf@redhat.com>
 
+       * fhandler_process.cc (fhandler_process::fill_filebuf): Open pinfo with
+       PID_MAP_RW.
+       * sigproc.cc (talktome): Ditto for winpids.
+
+2003-09-16  Christopher Faylor  <cgf@redhat.com>
+
        * pinfo.h (winpids::pid_access): New element.
        (winpids::winpids): Rejigger to set pinfo_access.
        * pinfo.cc (winpids::add): Try to open shared memory region with
index 44b7189..2ba1e53 100644 (file)
@@ -245,7 +245,8 @@ out:
 bool
 fhandler_process::fill_filebuf ()
 {
-  pinfo p (pid);
+  pinfo p (pid, PID_MAP_RW);   // PID_MAP_RW for cmdline since it
+                               // needs to signal the other process
 
   if (!p)
     {
index dff0730..6c53937 100644 (file)
@@ -1056,10 +1056,11 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child)
 static void
 talktome ()
 {
-  winpids pids;
+  winpids pids ((DWORD) PID_MAP_RW);
   for (unsigned i = 0; i < pids.npids; i++)
     if (pids[i]->hello_pid == myself->pid)
-      pids[i]->commune_recv ();
+      if (!IsBadWritePtr (pids[i], sizeof (_pinfo)))
+       pids[i]->commune_recv ();
 }
 
 #define RC_MAIN 0