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
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-12-27 03:25:02 +0300
committerChristopher Faylor <me@cgf.cx>2003-12-27 03:25:02 +0300
commit56b5feb639f51385da560289e1c1e65512fb3f67 (patch)
tree42bd37417563e78b79eedd998cab0bfe2b9ab685
parent6dc18ca4d35407e4da9b5497f595382aef732f74 (diff)
* exceptions.cc (try_to_debug): Fix off-by-one problem when resetting
environment variable after error_start detected. * fhandler_tty_slave.cc (fhandler_tty_slave::close): Clarify debug message. * syscalls.cc (setsid): Don't increment usecount here, since it will be automatically decremented on close.
-rw-r--r--winsup/cygwin/ChangeLog10
-rw-r--r--winsup/cygwin/exceptions.cc9
-rw-r--r--winsup/cygwin/fhandler_tty.cc2
-rw-r--r--winsup/cygwin/syscalls.cc2
4 files changed, 18 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a3cf7184f..a357ef49f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,15 @@
2003-12-26 Christopher Faylor <cgf@redhat.com>
+ * exceptions.cc (try_to_debug): Fix off-by-one problem when resetting
+ environment variable after error_start detected.
+
+ * fhandler_tty_slave.cc (fhandler_tty_slave::close): Clarify debug
+ message.
+ * syscalls.cc (setsid): Don't increment usecount here, since it will be
+ automatically decremented on close.
+
+2003-12-26 Christopher Faylor <cgf@redhat.com>
+
* exceptions.cc (setup_handler): Protect against a race.
2003-12-26 Christopher Faylor <cgf@redhat.com>
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 228d2c8e2..97955307b 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -350,12 +350,15 @@ try_to_debug (bool waitloop)
char* rawenv = GetEnvironmentStrings () ;
for (char* p = rawenv; *p != '\0'; p = strchr (p, '\0') + 1)
{
- if (strncmp (p, "CYGWIN=", sizeof ("CYGWIN=") - 1) == 0)
+ if (strncmp (p, "CYGWIN=", strlen ("CYGWIN=")) == 0)
{
char* q = strstr (p, "error_start") ;
/* replace 'error_start=...' with '_rror_start=...' */
- if (q) *q = '_' ;
- SetEnvironmentVariable ("CYGWIN", p + sizeof ("CYGWIN=")) ;
+ if (q)
+ {
+ *q = '_' ;
+ SetEnvironmentVariable ("CYGWIN", p + strlen ("CYGWIN=")) ;
+ }
break ;
}
}
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 60b12a939..d5cbcadd1 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -620,7 +620,7 @@ fhandler_tty_slave::close ()
if (archetype->usecount < 0)
system_printf ("usecount %d", archetype->usecount);
#endif
- termios_printf ("just exiting because archetype usecount is > 0");
+ termios_printf ("just returning because archetype usecount is > 0");
return 0;
}
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 2b2e97d85..ab8aeea00 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -335,7 +335,7 @@ setsid (void)
myself->pgid, myself->ctty, fhandler_console::open_fhs);
if (cygheap->ctty)
{
- if (!--cygheap->ctty->usecount)
+ if (cygheap->ctty->usecount == 1)
cygheap->ctty->close ();
cygheap->ctty = NULL;
}