From 5117938a5f4dfb20adfc228bd2615a758bd2cc4b Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Tue, 28 Aug 2018 18:11:46 +0300 Subject: [PATCH] redis: use TCSANOW instead of TCSAFLUSH Fix for https://github.com/termux/termux-packages/issues/2783 --- packages/redis/no-tcsaflush.patch | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 packages/redis/no-tcsaflush.patch diff --git a/packages/redis/no-tcsaflush.patch b/packages/redis/no-tcsaflush.patch new file mode 100644 index 000000000..ef213e575 --- /dev/null +++ b/packages/redis/no-tcsaflush.patch @@ -0,0 +1,21 @@ +diff -uNr redis-4.0.11/deps/linenoise/linenoise.c redis-4.0.11.mod/deps/linenoise/linenoise.c +--- redis-4.0.11/deps/linenoise/linenoise.c 2018-08-04 01:44:56.000000000 +0300 ++++ redis-4.0.11.mod/deps/linenoise/linenoise.c 2018-08-28 18:48:44.778320660 +0300 +@@ -241,7 +241,7 @@ + raw.c_cc[VMIN] = 1; raw.c_cc[VTIME] = 0; /* 1 byte, no timer */ + + /* put terminal in raw mode after flushing */ +- if (tcsetattr(fd,TCSAFLUSH,&raw) < 0) goto fatal; ++ if (tcsetattr(fd,TCSANOW,&raw) < 0) goto fatal; + rawmode = 1; + return 0; + +@@ -252,7 +252,7 @@ + + static void disableRawMode(int fd) { + /* Don't even check the return value as it's too late. */ +- if (rawmode && tcsetattr(fd,TCSAFLUSH,&orig_termios) != -1) ++ if (rawmode && tcsetattr(fd,TCSANOW,&orig_termios) != -1) + rawmode = 0; + } +