- If two PTYs are opened in the same process and the first one
is closed, the helper process for the first PTY remains running.
This patch fixes the issue.
- The slowing down issue of X11 forwarding using ssh -Y, reported
in https://www.cygwin.com/ml/cygwin/2019-12/msg00295.html,
is due to the change of select() code for pty in the commit
915fcd0ae8. cygthread::detach()
takes at most about 10msec because Sleep() is used in the thread.
For this issue, this patch uses cygwait() instead of Sleep() and
introduces an event to abort the wait. For not only pty, but pipe
and fifo also have the same problem potentially, so this patch
applies same strategy to them as well.
Though our implementation of cpu sets doesn't need it, software from
Linux environments expects this definition to be present. It's
documented on the Linux CPU_SET(3) man page but was left out due to
oversight.
Addresses https://cygwin.com/ml/cygwin/2019-12/msg00248.html
Add that flag to the pipe type argument when creating the Windows
named pipe. And add a definition of that flag to ntdll.h (copied from
/usr/include/w32api/ddk/ntifs.h).
- Even with commit fe512b2b12, pty
still has a problem in ESC[?3h and ESC[?3l handling if invalid
sequence such as ESC[?$ is sent. This patch fixes the issue.
In the two helper functions that _dcvt calls for 'f' and 'e' mode, if
there are no digits to display after the decimal point, don't add one.
Signed-off-by: Keith Packard <keithp@keithp.com>
Leading zeros after the decimal point should not count
towards the 'ndigits' limit.
This makes gcvt match glibc and the posix gcvt man page.
Signed-off-by: Keith Packard <keithp@keithp.com>
Even if the number is really small and this means showing *no* digits.
This makes newlib match glibc, and the fcvt posix man page.
Signed-off-by: Keith Packard <keithp@keithp.com>
Both functions were introduce with Windows 7 only, so we need to
autoload them for the sake of Vista/2008.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
On certain error conditions there is a code snippet that checks
whether the last component of the path has a trailing dot or space or
a leading space. Skip this check if the last component is empty,
i.e., if the path ends with a backslash. This avoids an assertion
failure if the trailing backslash is the only backslash in the path,
as is the case for a DOS drive 'X:\'.
Addresses: https://cygwin.com/ml/cygwin/2019-12/msg00016.html
sf_log1p was using __math_divzero and __math_invalid, which
drag in a pile of double-precision code. Switch to using the
single-precision variants. This also required making those
available in __OBSOLETE_MATH mode.
Signed-off-by: Keith Packard <keithp@keithp.com>
newlib wide char conversion functions were updated to
Unicode 11 on 2019-01-12
update standard symbol __STDC_ISO_10646__ to
Unicode 11 release date 2018-06-05 for Cygwin
The call to fflush was invalidating the read buffer, preventing relative
seeks to positions that would have been inside the read buffer from
being optimized. The call to srefill would then re-read mostly the same
data that was initially in the read buffer.
- Pseudo console clears console screen buffer if ESC[?3h or ESC[?3l
is sent. However, xterm/vt100 does not clear screen. This cause
mismatch between real screen and console screen buffer. Therefore,
this patch triggers redraw screen in that situation so that the
synchronization is done on the next execution of native app.
This solves the problem reported in:
https://www.cygwin.com/ml/cygwin-patches/2019-q4/msg00116.html
- Previously, pty cleared screen at startup for synchronization
between the real screen and console screen buffer for pseudo
console. With this patch, instead of clearing screen, the screen
is redrawn when the first native program is executed after pty
is created. In other words, synchronization is deferred until
the native app is executed. Moreover, this realizes excluding
$TERM dependent code.
s[0:3] contain a descriptor used to set up the initial value of the
stack, but only the lower 48 bits of s[0:1] are currently used.
The reent marker is currently set in s3, but by stashing it in the
upper 16 bits of s[0:1] instead, s3 can be freed up for other purposes.
fhandler_console::create_invisible_console_workaround() does not use the
lpApplicationName parameter and neglects to quote its command name on
lpCommandLine in the call to CreateProcessW.
Given CreateProcessW's brain-dead method to evaluate the application
path given on the command line, this opens up a security problem if
Cygwin is installed into a path with spaces in it.
Fix this by using the lpApplicationName parameter and quoting of the
application path in the lpCommandLine parameter (used as argv[0] in
the called console helper.
For extended paranoia, make the argument string array big enough to
fit full 64 bit pointer values into it. Handles usually only use
the lower 32 bit, but better safe than sorry.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
FH_CONS_MAX should refelect the fact that we allow 128 consoles, even if
it's unused.
Suggested-by: Achim Gratz <Stromeko@nexgo.de>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>