4d2cd41120
- Add musl.patch to workaround lack of certain FTW_ constants in musl - Add basename.patch to fix build error Closes: #7313 [via git-merge-pr]
35 lines
796 B
Diff
35 lines
796 B
Diff
musl does not implement glibc extensions such as FTW_STOP, FTW_CONTINUE, and
|
|
FTW_ACTIONRETVAL.
|
|
|
|
--- pe_profiling/operf.cpp 2017-08-08 13:44:44.573674304 -0400
|
|
+++ 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) {
|