]> sourceware.org Git - newlib-cygwin.git/commitdiff
* external.cc (fillout_pinfo): If start_time is 0, wait a while before
authorChristopher Faylor <me@cgf.cx>
Thu, 24 Oct 2013 15:26:21 +0000 (15:26 +0000)
committerChristopher Faylor <me@cgf.cx>
Thu, 24 Oct 2013 15:26:21 +0000 (15:26 +0000)
returning the pinfo structure.
* fhandler.cc (fhandler_base::open_setup): Convert from inline.
* fhandler.h (fhandler_base::open_setup): Declare.
* fhandler_console.cc (fhandler_console::open_setup): Always call
fhandler_base::open_setup.
* fhandler_tty.cc (fhandler_pty_slave::open_setup): Ditto.
(fhandler_pty_master::open_setup): Ditto.

winsup/cygwin/ChangeLog
winsup/cygwin/external.cc
winsup/cygwin/fhandler.cc
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_console.cc
winsup/cygwin/fhandler_tty.cc

index 2f70b1c099871a12d1d42b0743d194245d4ee717..e6f255ff4c2e1b60ced9f59faf2804e5c3e8523a 100644 (file)
@@ -1,3 +1,15 @@
+2013-10-24  Christopher Faylor  <me.cygwin2013@cgf.cx>
+
+       * external.cc (fillout_pinfo): If start_time is 0, wait a while before
+       returning the pinfo structure.
+
+       * fhandler.cc (fhandler_base::open_setup): Convert from inline.
+       * fhandler.h (fhandler_base::open_setup): Declare.
+       * fhandler_console.cc (fhandler_console::open_setup): Always call
+       fhandler_base::open_setup.
+       * fhandler_tty.cc (fhandler_pty_slave::open_setup): Ditto.
+       (fhandler_pty_master::open_setup): Ditto.
+
 2013-10-24  Corinna Vinschen  <corinna@vinschen.de>
 
        * devices.in (dev_storage): Map /dev/zero and /dev/full to \Device\Null.
index 4dc87bf80cd017e05c14b032d81772c4ba844d18..0027c5c0024c30d0709eb6714a50be69f09d3d22 100644 (file)
@@ -76,6 +76,13 @@ fillout_pinfo (pid_t pid, int winpid)
        }
       else if (nextpid || p->pid == pid || (winpid && thispid == (DWORD) pid))
        {
+         /* It is possible that this pinfo is not completely set up yet.  Wait
+            a while if so.  */
+         for (int i = 0; i < 2000; i++)
+           if (p->start_time)
+             break;
+           else
+             Sleep (1);
          ep.ctty = (p->ctty < 0 || iscons_dev (p->ctty)) ? p->ctty : device::minor (p->ctty);
          ep.pid = p->pid;
          ep.ppid = p->ppid;
index 6e4539c7210837604c555c66c3038fb4bc36fcc6..39dcbd0578435234d47181bc705e224184777461 100644 (file)
@@ -720,6 +720,11 @@ done:
   return res;
 }
 
+void
+fhandler_base::open_setup (int)
+{
+}
+
 /* states:
    open buffer in binary mode?  Just do the read.
 
index a0cdfa65c87b0bec982a286991f909e1e92aa860..0895bf88c5552b85927fb4bb1bf333ea8c37ddf7 100644 (file)
@@ -311,7 +311,7 @@ class fhandler_base
 
   int open_with_arch (int, mode_t = 0);
   virtual int open (int, mode_t);
-  virtual void open_setup (int flags) { return; }
+  virtual void open_setup (int flags);
   void set_unique_id () { NtAllocateLocallyUniqueId ((PLUID) &unique_id); }
 
   int close_with_arch ();
index 14802790aa1e65e50316f20029f422b193f267dd..ca84fed9c74cee3adf8f2707e570286782d2ecc7 100644 (file)
@@ -895,6 +895,7 @@ fhandler_console::open_setup (int flags)
   set_flags ((flags & ~O_TEXT) | O_BINARY);
   if (myself->set_ctty (this, flags) && !myself->cygstarted)
     init_console_handler (true);
+  fhandler_base::open_setup (flags);
 }
 
 int
index a5ab724346cde10c16672f9f9b59808d8dec3c46..e85fa9426c72af50081f2135cabef6810fe853e2 100644 (file)
@@ -562,6 +562,7 @@ fhandler_pty_slave::open_setup (int flags)
   set_flags ((flags & ~O_TEXT) | O_BINARY);
   myself->set_ctty (this, flags);
   report_tty_counts (this, "opened", "");
+  fhandler_base::open_setup (flags);
 }
 
 void
@@ -1247,6 +1248,7 @@ fhandler_pty_master::open_setup (int flags)
   char buf[sizeof ("opened pty master for ptyNNNNNNNNNNN")];
   __small_sprintf (buf, "opened pty master for pty%d", get_minor ());
   report_tty_counts (this, buf, "");
+  fhandler_base::open_setup (flags);
 }
 
 off_t
This page took 0.042862 seconds and 5 git commands to generate.