mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-05-05 15:16:19 +02:00
47840: make zpty module work on Cygwin
This commit is contained in:
parent
ce0660b7ba
commit
bf8ca5f019
|
@ -1,3 +1,8 @@
|
||||||
|
2021-01-20 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||||
|
|
||||||
|
* Peiyuan Song: 47840: Src/Modules/zpty.c, configure.ac: make
|
||||||
|
zpty module work on Cygwin
|
||||||
|
|
||||||
2020-12-12 dana <dana@dana.is>
|
2020-12-12 dana <dana@dana.is>
|
||||||
|
|
||||||
* unposted: NEWS: Catch up on new features
|
* unposted: NEWS: Catch up on new features
|
||||||
|
|
|
@ -30,6 +30,13 @@
|
||||||
#include "zpty.mdh"
|
#include "zpty.mdh"
|
||||||
#include "zpty.pro"
|
#include "zpty.pro"
|
||||||
|
|
||||||
|
#ifdef __CYGWIN__
|
||||||
|
#include <cygwin/version.h>
|
||||||
|
#if defined(CYGWIN_VERSION_DLL_MAJOR) && CYGWIN_VERSION_DLL_MAJOR<3002
|
||||||
|
#define USE_CYGWIN_FIX 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The number of bytes we normally read when given no pattern and the
|
/* The number of bytes we normally read when given no pattern and the
|
||||||
* upper bound on the number of bytes we read (even if we are give a
|
* upper bound on the number of bytes we read (even if we are give a
|
||||||
* pattern). */
|
* pattern). */
|
||||||
|
@ -428,6 +435,7 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
|
||||||
mypid = 0; /* trick to ensure we _exit() */
|
mypid = 0; /* trick to ensure we _exit() */
|
||||||
zexit(lastval, ZEXIT_NORMAL);
|
zexit(lastval, ZEXIT_NORMAL);
|
||||||
}
|
}
|
||||||
|
#ifndef USE_CYGWIN_FIX
|
||||||
master = movefd(master);
|
master = movefd(master);
|
||||||
if (master == -1) {
|
if (master == -1) {
|
||||||
zerrnam(nam, "cannot duplicate fd %d: %e", master, errno);
|
zerrnam(nam, "cannot duplicate fd %d: %e", master, errno);
|
||||||
|
@ -435,6 +443,9 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
|
||||||
ineval = oineval;
|
ineval = oineval;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
addmodulefd(master, FDT_INTERNAL);
|
||||||
|
#endif
|
||||||
|
|
||||||
p = (Ptycmd) zalloc(sizeof(*p));
|
p = (Ptycmd) zalloc(sizeof(*p));
|
||||||
|
|
||||||
|
|
|
@ -2460,7 +2460,7 @@ if test x$ac_cv_have_dev_ptmx = xyes -o x$ac_cv_func_posix_openpt = xyes && \
|
||||||
test x$ac_cv_func_ptsname = xyes; then
|
test x$ac_cv_func_ptsname = xyes; then
|
||||||
AC_CACHE_CHECK([if /dev/ptmx is usable],
|
AC_CACHE_CHECK([if /dev/ptmx is usable],
|
||||||
ac_cv_use_dev_ptmx,
|
ac_cv_use_dev_ptmx,
|
||||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef __linux
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if defined(__linux) || defined(__CYGWIN__)
|
||||||
#define _GNU_SOURCE 1
|
#define _GNU_SOURCE 1
|
||||||
#endif
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
Loading…
Reference in New Issue