Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2013-10-24 19:26:21 +0400
committerChristopher Faylor <me@cgf.cx>2013-10-24 19:26:21 +0400
commit4ae84b225105921c1ceef22ff541b06ba7558c11 (patch)
treee9ecdee88c2f75aca15c9bb1c5364a14bd846bed /winsup
parent84e7adad1da635f1f2305704c756e66936f2f1d8 (diff)
* 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.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog12
-rw-r--r--winsup/cygwin/external.cc7
-rw-r--r--winsup/cygwin/fhandler.cc5
-rw-r--r--winsup/cygwin/fhandler.h2
-rw-r--r--winsup/cygwin/fhandler_console.cc1
-rw-r--r--winsup/cygwin/fhandler_tty.cc2
6 files changed, 28 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 2f70b1c09..e6f255ff4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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.
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
index 4dc87bf80..0027c5c00 100644
--- a/winsup/cygwin/external.cc
+++ b/winsup/cygwin/external.cc
@@ -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;
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 6e4539c72..39dcbd057 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -720,6 +720,11 @@ done:
return res;
}
+void
+fhandler_base::open_setup (int)
+{
+}
+
/* states:
open buffer in binary mode? Just do the read.
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index a0cdfa65c..0895bf88c 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -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 ();
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 14802790a..ca84fed9c 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -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
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index a5ab72434..e85fa9426 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -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