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