preload-hacks: Some patches to make it work.
[termux-packages] / packages / gawk / io.c.patch
CommitLineData
0e5dac62
FF
1diff -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 @@
951e2f60 5
0e5dac62
FF
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);
951e2f60 11
0e5dac62
FF
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);
951e2f60 20
0e5dac62
FF
21 case -1:
22@@ -2364,7 +2364,7 @@
522ec400
FF
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);
0e5dac62 31@@ -2422,7 +2422,7 @@
951e2f60
FF
32 fatal(_("close of pipe failed (%s)"), strerror(errno));
33 /* stderr does NOT get dup'ed onto child's stdout */
522ec400 34 set_sigpipe_to_default();
951e2f60
FF
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__ */
0e5dac62 40@@ -2634,7 +2634,7 @@
522ec400
FF
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);
0e5dac62 49@@ -2659,7 +2659,7 @@
951e2f60
FF
50 if (close(p[0]) == -1 || close(p[1]) == -1)
51 fatal(_("close of pipe failed (%s)"), strerror(errno));
522ec400 52 set_sigpipe_to_default();
951e2f60
FF
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__ */