From 93b884f130ad52c7ec552866aeada84a9963f7db Mon Sep 17 00:00:00 2001 From: Francisco Demartino Date: Thu, 24 Dec 2015 04:04:00 -0300 Subject: [PATCH] ndk_patches/stdio.h.patch: add bogus ctermid() --- ndk_patches/stdio.h.patch | 15 +++++++++++---- packages/fish/reader.cpp.patch | 17 ----------------- packages/perl/POSIX.xs.patch | 12 ------------ 3 files changed, 11 insertions(+), 33 deletions(-) delete mode 100644 packages/fish/reader.cpp.patch delete mode 100644 packages/perl/POSIX.xs.patch diff --git a/ndk_patches/stdio.h.patch b/ndk_patches/stdio.h.patch index a91459fae..630c4c900 100644 --- a/ndk_patches/stdio.h.patch +++ b/ndk_patches/stdio.h.patch @@ -2,7 +2,7 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/incl --- /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/include/stdio.h 2014-10-14 22:53:49.000000000 -0400 +++ ./usr/include/stdio.h 2014-12-14 15:11:46.007242332 -0500 @@ -193,7 +193,7 @@ - + /* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ #if __BSD_VISIBLE || __XPG_VISIBLE -#define P_tmpdir "/tmp/" @@ -10,13 +10,20 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/incl #endif #define L_tmpnam 1024 /* XXX must be == PATH_MAX */ #define TMP_MAX 308915776 -@@ -371,6 +371,9 @@ +@@ -371,6 +371,16 @@ #define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) #endif /* __BSD_VISIBLE */ - + +/* Needed by gnulibs freading() */ +#define __sferror(p) (((p)->_flags & __SERR) != 0) ++ ++/* Used by perl, fish, and others */ ++static char* ctermid(char* s) { ++ if (s == 0) return "/dev/tty"; ++ strcpy(s, "/dev/tty"); ++ return s; ++} + #if defined(__BIONIC_FORTIFY) - + __BEGIN_DECLS diff --git a/packages/fish/reader.cpp.patch b/packages/fish/reader.cpp.patch deleted file mode 100644 index 7d4cc4281..000000000 --- a/packages/fish/reader.cpp.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -u -r ../fish-2.1.1/reader.cpp ./reader.cpp ---- ../fish-2.1.1/reader.cpp 2014-09-24 05:51:07.000000000 -0400 -+++ ./src/reader.cpp 2015-02-05 17:37:16.298415721 -0500 -@@ -1961,12 +1961,7 @@ - { - /* Try reading from the tty; if we get EIO we are orphaned. This is sort of bad because it may block. */ - -- char *tty = ctermid(NULL); -- if (! tty) -- { -- wperror(L"ctermid"); -- exit_without_destructors(1); -- } -+ char *tty = "/dev/tty"; - - /* Open the tty. Presumably this is stdin, but maybe not? */ - int tty_fd = open(tty, O_RDONLY | O_NONBLOCK); diff --git a/packages/perl/POSIX.xs.patch b/packages/perl/POSIX.xs.patch deleted file mode 100644 index 53882a2df..000000000 --- a/packages/perl/POSIX.xs.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -u -r ../perl-5.20.1/ext/POSIX/POSIX.xs ./ext/POSIX/POSIX.xs ---- ../perl-5.20.1/ext/POSIX/POSIX.xs 2014-09-14 07:31:01.000000000 -0400 -+++ ./ext/POSIX/POSIX.xs 2015-01-03 09:28:31.432423313 -0500 -@@ -1714,7 +1714,7 @@ - #ifdef HAS_CTERMID_R - s = (char *) safemalloc((size_t) L_ctermid); - #endif -- RETVAL = ctermid(s); -+ RETVAL = "/dev/tty"; - OUTPUT: - RETVAL - CLEANUP: