void-packages/srcpkgs/trace-cmd/patches/musl-no_pthread_attr_setaffinity_np.patch
Đoàn Trần Công Danh 4f75cf25fd srcpkgs/t*: 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

24 lines
849 B
Diff

--- a/tracecmd/trace-tsync.c 2020-07-17 17:14:20.000000000 +0200
+++ b/tracecmd/trace-tsync.c 2020-07-18 16:41:53.175645746 +0200
@@ -104,8 +104,10 @@
pthread_attr_init(&attrib);
pthread_attr_setdetachstate(&attrib, PTHREAD_CREATE_JOINABLE);
+#if defined(__GLIBC__)
if (!get_first_cpu(&pin_mask, &mask_size))
pthread_attr_setaffinity_np(&attrib, mask_size, pin_mask);
+#endif
ret = pthread_create(&instance->tsync_thread, &attrib,
tsync_host_thread, &instance->tsync);
@@ -243,8 +245,10 @@
pthread_attr_init(&attrib);
tsync->sync_proto = proto;
pthread_attr_setdetachstate(&attrib, PTHREAD_CREATE_JOINABLE);
+#if defined(__GLIBC__)
if (!get_first_cpu(&pin_mask, &mask_size))
pthread_attr_setaffinity_np(&attrib, mask_size, pin_mask);
+#endif
ret = pthread_create(thr_id, &attrib, tsync_agent_thread, tsync);