diff options
author | angelo <angelo@freebsd.(none)> | 2012-06-06 15:26:37 +0000 |
---|---|---|
committer | angelo <angelo@freebsd.(none)> | 2012-06-06 15:26:37 +0000 |
commit | ffcaeb2f05dea9a6387e1d24bc9671c1aa879964 (patch) | |
tree | 2d155f2ee779f95ef4ff3d7c94bbfeb6403d9972 | |
parent | 0ba6a181d84c196c9d9854ded7528baac66af461 (diff) | |
download | cpulimit-ffcaeb2f05dea9a6387e1d24bc9671c1aa879964.tar.gz |
fixed compilation on freebsd
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/cpulimit.c | 17 | ||||
-rwxr-xr-x | tests/busy | bin | 8672 -> 5771 bytes | |||
-rw-r--r-- | tests/busy.c | 3 |
5 files changed, 4 insertions, 19 deletions
@@ -1,3 +1,4 @@ *.o *~ src/cpulimit +busy diff --git a/src/Makefile b/src/Makefile index 33c632d..6deb69b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ CC?=gcc -CFLAGS?=-Wall -O2 +CFLAGS?=-Wall -O2 -D_GNU_SOURCE TARGETS=cpulimit LIBS=process.o procutils.o list.o diff --git a/src/cpulimit.c b/src/cpulimit.c index 300d320..6126c6b 100644 --- a/src/cpulimit.c +++ b/src/cpulimit.c @@ -99,23 +99,6 @@ int verbose = 0; //lazy mode (exits if there is no process) int lazy = 0; -static void *memrchr(const void *s, int c, size_t n) -{ - const unsigned char *start = (const unsigned char*)s; - const unsigned char *end = (const unsigned char*)s; - - end+=n-1; - - while(end>=start) { - if(*end==c) - return (void *)end; - else - end--; - } - - return NULL; -} - //SIGINT and SIGTERM signal handler static void quit(int sig) { Binary files differdiff --git a/tests/busy.c b/tests/busy.c index bb2e2ed..4839033 100644 --- a/tests/busy.c +++ b/tests/busy.c @@ -26,4 +26,5 @@ int main(int argc, char **argv) { printf("Press ENTER to exit..."); getchar(); return 0; -}
\ No newline at end of file +} + |