mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
pty.c: Restore build on systems without cfmakeraw(3) (re: 5a2e7dae
)
The OpenSUSE patch uses cfmakeraw(3) which is on Linux, BSD and macOS, but not portable. The build failed on Solaris and variants. src/cmd/builtin/features/pty: - Add simple test for the presence of cfmakeraw(3). I love iffe. src/cmd/builtin/pty.c: - Add POSIX compliant fallback flaggery for systems without it.
This commit is contained in:
parent
8e45daeaf1
commit
206bba4f2e
2 changed files with 8 additions and 0 deletions
|
@ -11,6 +11,7 @@ header stropts.h
|
||||||
|
|
||||||
lib openpty,_getpty,ptsname -lutil
|
lib openpty,_getpty,ptsname -lutil
|
||||||
lib grantpt,unlockpt,posix_openpt stdlib.h
|
lib grantpt,unlockpt,posix_openpt stdlib.h
|
||||||
|
lib cfmakeraw termios.h
|
||||||
|
|
||||||
tst - output{
|
tst - output{
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
|
@ -236,7 +236,14 @@ mkpty(int* master, int* slave)
|
||||||
{
|
{
|
||||||
if (errno != ENOTTY)
|
if (errno != ENOTTY)
|
||||||
error(-1, "unable to get standard error terminal attributes");
|
error(-1, "unable to get standard error terminal attributes");
|
||||||
|
#if _lib_cfmakeraw
|
||||||
cfmakeraw(&tty);
|
cfmakeraw(&tty);
|
||||||
|
#else
|
||||||
|
tty.c_iflag |= IGNPAR;
|
||||||
|
tty.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF);
|
||||||
|
tty.c_oflag &= ~OPOST;
|
||||||
|
tty.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
|
||||||
|
#endif /* _lib_cfmakeraw */
|
||||||
ttyp = 0;
|
ttyp = 0;
|
||||||
}
|
}
|
||||||
tty.c_lflag |= ICANON | IEXTEN | ISIG | ECHO|ECHOE|ECHOK|ECHOKE;
|
tty.c_lflag |= ICANON | IEXTEN | ISIG | ECHO|ECHOE|ECHOK|ECHOKE;
|
||||||
|
|
Loading…
Reference in a new issue