void-packages/srcpkgs/rpcbind/patches/musl-sunrpc.patch
Đoàn Trần Công Danh 103ab731ab srcpkgs/r*: convert patches to -Np1
* runit is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

25 lines
1.2 KiB
Diff

The musl implementation of getaddrinfo and getservbyname does not
aliases. As a workaround we use "sunprc" instead of "portmapper"
diff --git a/src/rpcbind.c b/src/rpcbind.c
index 83dbe93..9404df7 100644
--- a/src/rpcbind.c
+++ b/src/rpcbind.c
@@ -416,7 +416,7 @@ init_transport(struct netconfig *nconf)
if ((aicode = getaddrinfo(hosts[nhostsbak],
servname, &hints, &res)) != 0) {
if ((aicode = getaddrinfo(hosts[nhostsbak],
- "portmapper", &hints, &res)) != 0) {
+ "sunrpc", &hints, &res)) != 0) {
syslog(LOG_ERR,
"cannot get local address for %s: %s",
nconf->nc_netid, gai_strerror(aicode));
@@ -489,7 +489,7 @@ init_transport(struct netconfig *nconf)
if ((strcmp(nconf->nc_netid, "local") != 0) &&
(strcmp(nconf->nc_netid, "unix") != 0)) {
if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) {
- if ((aicode = getaddrinfo(NULL, "portmapper", &hints, &res))!= 0) {
+ if ((aicode = getaddrinfo(NULL, "sunrpc", &hints, &res))!= 0) {
printf("cannot get local address for %s: %s", nconf->nc_netid, gai_strerror(aicode));
syslog(LOG_ERR,
"cannot get local address for %s: %s",