0001-musl.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Remove non-Posix use of FTW_ACTIONRETVAL
  2. The musl implementation of nftw doesn't support the glibc extension
  3. FTW_ACTIONRETVAL. Since none of the features of FTW_ACTIONRETVAL are
  4. used here, just use the normal nftw return value.
  5. Downloaded from:
  6. https://github.com/openwrt-mirror/openwrt/blob/f22d5e25660106a48727c7aa5d1a73e4171a7987/package/devel/oprofile/patches/100-musl.patch
  7. after I found a hint for the patch here:
  8. http://patchwork.openembedded.org/patch/112675/
  9. Removed unneeded patch for libop/op_events.c.
  10. Because openwrt removed the oprofile package from their repo last week
  11. https://github.com/openwrt-mirror/openwrt/commit/aaf46a8524e138e1673a398e8d2dd9357405b313#diff-fe14456f94abf436d997e2c01c10f3bd
  12. I decided to put this patch into the buildroot repo instead of adding
  13. _PATCH to oprofile.mk
  14. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  15. --- a/pe_profiling/operf.cpp
  16. +++ b/pe_profiling/operf.cpp
  17. @@ -857,11 +857,14 @@ static int __delete_old_previous_sample_
  18. int tflag __attribute__((unused)),
  19. struct FTW *ftwbuf __attribute__((unused)))
  20. {
  21. + int err;
  22. +
  23. if (remove(fpath)) {
  24. + err = errno;
  25. perror("sample data removal error");
  26. - return FTW_STOP;
  27. + return err;
  28. } else {
  29. - return FTW_CONTINUE;
  30. + return 0;
  31. }
  32. }
  33. @@ -896,7 +899,7 @@ static void convert_sample_data(void)
  34. return;
  35. if (!operf_options::append) {
  36. - int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
  37. + int flags = FTW_DEPTH;
  38. errno = 0;
  39. if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 &&
  40. errno != ENOENT) {