Files
termux-packages/packages/stdoutisatty/soname.patch
termux-pacman-bot 7e0034585e add(main): stdoutisatty
what: https://wiki.archlinux.org/title/Color_output_in_console#Reading_from_stdin

why: unlike unbuffer, this only does not employ pty pair
reduced resource usage a little.

It also supports `ld_preload` usage, avoiding extra `execve()`.
2022-09-27 06:47:57 +00:00

14 lines
436 B
Diff

diff --git a/libstdoutisatty.c b/libstdoutisatty.c
index 0516cdd..a5f4762 100644
--- a/libstdoutisatty.c
+++ b/libstdoutisatty.c
@@ -43,7 +43,7 @@ __attribute__ ((constructor)) static void setup(void) {
void *libhdl;
char *dlerr;
- if (!(libhdl=dlopen("libc.so.6", RTLD_LAZY)))
+ if (!(libhdl=dlopen("libc.so", RTLD_LAZY)))
die("Failed to patch library calls: %s", dlerror());
orig_isatty = dlsym(libhdl, "isatty");