void-packages/srcpkgs/belle-sip/patches/musl.patch
Đoàn Trần Công Danh c6ce65d3d0 srcpkgs/b*: convert patches to -Np1
```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

26 lines
1 KiB
Diff

--- a/src/belle_sip_resolver.c 2018-02-21 17:30:40.474348393 +0100
+++ b/src/belle_sip_resolver.c 2018-02-21 17:30:40.474348393 +0100
@@ -459,7 +459,11 @@
}
static void append_dns_result(belle_sip_simple_resolver_context_t *ctx, struct addrinfo **ai_list, struct sockaddr *addr, socklen_t addrlen){
+#if defined(__GLIBC__)
char host[NI_MAXHOST + 1];
+#else
+ char host[1026];
+#endif
int gai_err;
int family=ctx->family;
@@ -529,7 +533,11 @@
append_dns_result(ctx,&ctx->ai_list,(struct sockaddr*)&sin,sizeof(sin));
if (rr.ttl < BELLE_SIP_RESOLVER_CONTEXT(ctx)->min_ttl) BELLE_SIP_RESOLVER_CONTEXT(ctx)->min_ttl = rr.ttl;
} else if ((ctx->type == DNS_T_SRV) && (rr.class == DNS_C_IN) && (rr.type == DNS_T_SRV)) {
+#if defined(__GLIBC__)
char host[NI_MAXHOST + 1];
+#else
+ char host[1026];
+#endif
struct dns_srv *srv = &any.srv;
belle_sip_dns_srv_t * b_srv=belle_sip_dns_srv_create(srv);
snprintf(host, sizeof(host), "[target:%s port:%d prio:%d weight:%d]", srv->target, srv->port, srv->priority, srv->weight);