void-packages/srcpkgs/oprofile/patches/musl.patch
Đoàn Trần Công Danh 2fd8d4df94 srcpkgs/o*: 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

35 lines
800 B
Diff

musl does not implement glibc extensions such as FTW_STOP, FTW_CONTINUE, and
FTW_ACTIONRETVAL.
--- a/pe_profiling/operf.cpp 2017-08-08 13:44:44.573674304 -0400
+++ b/pe_profiling/operf.cpp 2017-08-08 13:46:27.876692262 -0400
@@ -860,9 +860,17 @@
{
if (remove(fpath)) {
perror("sample data removal error");
+#ifdef __GLIBC__
return FTW_STOP;
+#else
+ return errno;
+#endif
} else {
+#ifdef __GLIBC__
return FTW_CONTINUE;
+#else
+ return 0;
+#endif
}
}
@@ -897,7 +905,11 @@
return;
if (!operf_options::append) {
+#ifdef __GLIBC__
int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
+#else
+ int flags = FTW_DEPTH;
+#endif
errno = 0;
if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 &&
errno != ENOENT) {