termux-packages/packages/multitail/my_pty.c.patch
Fredrik Fornwall 59f0d218a6 Initial push
2015-06-13 01:03:31 +02:00

40 lines
2.0 KiB
Diff

diff -u -r ../multitail-6.2.1/my_pty.c ./my_pty.c
--- ../multitail-6.2.1/my_pty.c 2014-02-16 15:06:54.000000000 +0100
+++ ./my_pty.c 2014-06-30 16:54:44.000000000 +0200
@@ -29,7 +29,7 @@
#ifdef __OpenBSD__
#include <util.h>
#endif
-#if defined(linux) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__)
+#if (defined(linux) && !defined(__ANDROID__)) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__)
#include <pty.h>
#endif
#if defined(__FreeBSD__) || defined(__minix)
@@ -78,7 +78,7 @@
int get_pty_and_fork(int *fd_master, int *fd_slave)
{
-#if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__) || defined(__minix)
+#if defined(__FreeBSD__) || (defined(linux) && !defined(__ANDROID__)) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__) || defined(__minix)
if (openpty(fd_master, fd_slave, NULL, NULL, NULL) == -1)
{
@@ -88,7 +88,7 @@
return fork();
-#elif defined(sun) || defined(__sun) || defined(AIX) || defined(_HPUX_SOURCE) || defined(OSF1) || defined(scoos)
+#elif defined(sun) || defined(__sun) || defined(AIX) || defined(_HPUX_SOURCE) || defined(OSF1) || defined(scoos) || defined(__ANDROID__)
/*
* This code is used e.g. on Solaris 2.x. (Note that Solaris 2.3
@@ -123,7 +123,7 @@
*fd_slave = myopen(pts, O_RDWR | O_NOCTTY);
if (*fd_slave < 0) error_exit(TRUE, FALSE, "Problem opening slave-side of pseudo tty (file '%s').\n", pts);
-#if !defined(AIX) && !defined(scoos)
+#if !defined(AIX) && !defined(scoos) && !defined(__ANDROID__)
/* Push the appropriate streams modules, as described in Solaris pts(7). */
if (ioctl(*fd_slave, I_PUSH, "ptem") < 0) error_exit(TRUE, FALSE, "ioctl I_PUSH ptem failed.\n");
if (ioctl(*fd_slave, I_PUSH, "ldterm") < 0) error_exit(TRUE, FALSE, "ioctl I_PUSH ldterm failed.\n");