Update `HACKING'.
[jackhill/guix/guix.git] / distro / packages / patches / gawk-shell.patch
1 As for libc's `system', change Awk to look for `sh' in $PATH. This patch is
2 only meant to be used during bootstrapping, where we don't know in advance the
3 absolute file name of `sh'.
4
5 --- gawk-4.0.0/io.c 2011-05-18 20:47:29.000000000 +0200
6 +++ gawk-4.0.0/io.c 2012-12-18 15:56:06.000000000 +0100
7 @@ -1759,7 +1759,7 @@ two_way_open(const char *str, struct red
8
9 signal(SIGPIPE, SIG_DFL);
10
11 - execl("/bin/sh", "sh", "-c", str, NULL);
12 + execlp("sh", "sh", "-c", str, NULL);
13 _exit(errno == ENOENT ? 127 : 126);
14
15 case -1:
16 @@ -1924,7 +1924,7 @@ use_pipes:
17 || close(ctop[0]) == -1 || close(ctop[1]) == -1)
18 fatal(_("close of pipe failed (%s)"), strerror(errno));
19 /* stderr does NOT get dup'ed onto child's stdout */
20 - execl("/bin/sh", "sh", "-c", str, NULL);
21 + execlp("sh", "sh", "-c", str, NULL);
22 _exit(errno == ENOENT ? 127 : 126);
23 }
24 #endif /* NOT __EMX__ */
25 @@ -2074,7 +2074,7 @@ gawk_popen(const char *cmd, struct redir
26 fatal(_("moving pipe to stdout in child failed (dup: %s)"), strerror(errno));
27 if (close(p[0]) == -1 || close(p[1]) == -1)
28 fatal(_("close of pipe failed (%s)"), strerror(errno));
29 - execl("/bin/sh", "sh", "-c", cmd, NULL);
30 + execlp("sh", "sh", "-c", cmd, NULL);
31 _exit(errno == ENOENT ? 127 : 126);
32 }
33 #endif /* NOT __EMX__ */
34