preload-hacks: Some patches to make it work.
[termux-packages] / packages / gawk / io.c.patch
1 diff -u -r ../gawk-4.2.1/io.c ./io.c
2 --- ../gawk-4.2.1/io.c 2018-02-19 17:55:00.000000000 +0000
3 +++ ./io.c 2018-02-27 11:12:19.067766916 +0000
4 @@ -2025,7 +2025,7 @@
5
6 set_sigpipe_to_default();
7
8 - execl("/bin/sh", "sh", "-c", command, NULL);
9 + execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", command, NULL);
10 _exit(errno == ENOENT ? 127 : 126);
11
12 case -1:
13 @@ -2077,7 +2077,7 @@
14
15 signal(SIGPIPE, SIG_DFL);
16
17 - execl("/bin/sh", "sh", "-c", command, NULL);
18 + execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", command, NULL);
19 _exit(errno == ENOENT ? 127 : 126);
20
21 case -1:
22 @@ -2364,7 +2364,7 @@
23
24 /* stderr does NOT get dup'ed onto child's stdout */
25 #ifdef __EMX__
26 - pid = spawnl(P_NOWAIT, "/bin/sh", "sh", "-c", str, NULL);
27 + pid = spawnl(P_NOWAIT, "@TERMUX_PREFIX@/bin/sh", "sh", "-c", str, NULL);
28 #else /* __MINGW32__ */
29 pid = spawnl(P_NOWAIT, getenv("ComSpec"), "cmd.exe", "/c",
30 qcmd = quote_cmd(str), NULL);
31 @@ -2422,7 +2422,7 @@
32 fatal(_("close of pipe failed (%s)"), strerror(errno));
33 /* stderr does NOT get dup'ed onto child's stdout */
34 set_sigpipe_to_default();
35 - execl("/bin/sh", "sh", "-c", str, NULL);
36 + execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", str, NULL);
37 _exit(errno == ENOENT ? 127 : 126);
38 }
39 #endif /* NOT __EMX__, NOT __MINGW32__ */
40 @@ -2634,7 +2634,7 @@
41 os_close_on_exec(save_stdout, cmd, "pipe", "from"); /* saved stdout of the parent process */
42
43 #ifdef __EMX__
44 - pid = spawnl(P_NOWAIT, "/bin/sh", "sh", "-c", cmd, NULL);
45 + pid = spawnl(P_NOWAIT, "@TERMUX_PREFIX@/bin/sh", "sh", "-c", cmd, NULL);
46 #else /* __MINGW32__ */
47 pid = spawnl(P_NOWAIT, getenv("ComSpec"), "cmd.exe", "/c",
48 qcmd = quote_cmd(cmd), NULL);
49 @@ -2659,7 +2659,7 @@
50 if (close(p[0]) == -1 || close(p[1]) == -1)
51 fatal(_("close of pipe failed (%s)"), strerror(errno));
52 set_sigpipe_to_default();
53 - execl("/bin/sh", "sh", "-c", cmd, NULL);
54 + execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", cmd, NULL);
55 _exit(errno == ENOENT ? 127 : 126);
56 }
57 #endif /* NOT __EMX__, NOT __MINGW32__ */