Initial push
[termux-packages] / packages / multitail / my_pty.c.patch
1 diff -u -r ../multitail-6.2.1/my_pty.c ./my_pty.c
2 --- ../multitail-6.2.1/my_pty.c 2014-02-16 15:06:54.000000000 +0100
3 +++ ./my_pty.c 2014-06-30 16:54:44.000000000 +0200
4 @@ -29,7 +29,7 @@
5 #ifdef __OpenBSD__
6 #include <util.h>
7 #endif
8 -#if defined(linux) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__)
9 +#if (defined(linux) && !defined(__ANDROID__)) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__)
10 #include <pty.h>
11 #endif
12 #if defined(__FreeBSD__) || defined(__minix)
13 @@ -78,7 +78,7 @@
14
15 int get_pty_and_fork(int *fd_master, int *fd_slave)
16 {
17 -#if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__) || defined(__minix)
18 +#if defined(__FreeBSD__) || (defined(linux) && !defined(__ANDROID__)) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__) || defined(__minix)
19
20 if (openpty(fd_master, fd_slave, NULL, NULL, NULL) == -1)
21 {
22 @@ -88,7 +88,7 @@
23
24 return fork();
25
26 -#elif defined(sun) || defined(__sun) || defined(AIX) || defined(_HPUX_SOURCE) || defined(OSF1) || defined(scoos)
27 +#elif defined(sun) || defined(__sun) || defined(AIX) || defined(_HPUX_SOURCE) || defined(OSF1) || defined(scoos) || defined(__ANDROID__)
28
29 /*
30 * This code is used e.g. on Solaris 2.x. (Note that Solaris 2.3
31 @@ -123,7 +123,7 @@
32 *fd_slave = myopen(pts, O_RDWR | O_NOCTTY);
33 if (*fd_slave < 0) error_exit(TRUE, FALSE, "Problem opening slave-side of pseudo tty (file '%s').\n", pts);
34
35 -#if !defined(AIX) && !defined(scoos)
36 +#if !defined(AIX) && !defined(scoos) && !defined(__ANDROID__)
37 /* Push the appropriate streams modules, as described in Solaris pts(7). */
38 if (ioctl(*fd_slave, I_PUSH, "ptem") < 0) error_exit(TRUE, FALSE, "ioctl I_PUSH ptem failed.\n");
39 if (ioctl(*fd_slave, I_PUSH, "ldterm") < 0) error_exit(TRUE, FALSE, "ioctl I_PUSH ldterm failed.\n");