[Buildroot] [PATCH v2] package: Add cpulimit
Peter Korsgaard
peter at korsgaard.com
Wed May 4 21:48:08 UTC 2022
>>>>> "Florian" == Florian Fainelli <f.fainelli at gmail.com> writes:
Hi,
>> > +Subject: [PATCH] Fix crash (and compiler warnings)
>> > +
>> > +Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
>> > +---
>> > + src/cpulimit.c | 2 +-
>> > + src/process_group.c | 4 ++++
>> > + tests/process_iterator_test.c | 2 +-
>> > + 3 files changed, 6 insertions(+), 2 deletions(-)
>> > +
>> > +diff --git a/src/cpulimit.c b/src/cpulimit.c
>> > +index 50eabeacf214..42d7ca280738 100644
>> > +--- a/src/cpulimit.c
>> > ++++ b/src/cpulimit.c
>> > +@@ -43,7 +43,7 @@
>> > + #include <sys/types.h>
>> > + #include <sys/wait.h>
>> > +
>> > +-#ifdef __APPLE__ || __FREEBSD__
>> > ++#if defined(__APPLE__) || defined(__FREEBSD__)
>> > + #include <libgen.h>
>> > + #endif
>> Why is this patch interesting in the context of Buildroot?
>> Presumably
>> neither __APPLE__ or __FREEBSD__ will be defined?
> Right, neither would be defined and therefore we would get the
> following build warning:
> /usr/include/x86_64-linux-gnu/sys/sysctl.h:21:2: warning: #warning
> "The <sys/sysctl.h> header is deprecated and will be removed." [-Wcpp]
> 21 | #warning "The <sys/sysctl.h> header is deprecated and will be
> removed."
> | ^~~~~~~
> cpulimit.c:46:18: warning: extra tokens at end of #ifdef directive
> 46 | #ifdef __APPLE__ || __FREEBSD__
> | ^~
Ok, so it is about the 2nd warning? The commit message mentioned
something about a crash, which sounded odd to me.
--
Bye, Peter Korsgaard
More information about the buildroot
mailing list