From 941b823d1c2c921d737a49c81772d186f0000925 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 14 Nov 2023 23:25:45 +0300 Subject: [PATCH] config.h fixed --- config.h | 7 ++++++- procps/uptime.c | 3 ++- sysutils/dmesg.c | 1 - 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config.h b/config.h index f67bf55..06641aa 100644 --- a/config.h +++ b/config.h @@ -7,8 +7,13 @@ /* Random source for shred */ #define RAND_SOURCE "/dev/urandom" -/* Options. To disable, comment line */ +/* Options: To disable, comment line */ /* Add escape-char support in echo */ #define ECHO_FANCY +/* getloadavg() unavailable in android os */ +#ifndef __ANDROID__ +#define UPTIME_LOADAVG +#endif + #endif diff --git a/procps/uptime.c b/procps/uptime.c index 5756337..5b0414d 100644 --- a/procps/uptime.c +++ b/procps/uptime.c @@ -1,6 +1,7 @@ #include #include #include +#include "config.h" #if defined(CLOCK_BOOTTIME) #define CLOCK CLOCK_BOOTTIME @@ -38,7 +39,7 @@ int main(void) { printf(" %d mins", mins); } -#ifndef __ANDROID__ +#ifdef UPTIME_LOADAVG /* Print 1, 5 and 15 minute load averages */ double avg[3] = {0, 0, 0}; diff --git a/sysutils/dmesg.c b/sysutils/dmesg.c index b1f34f3..7af7943 100644 --- a/sysutils/dmesg.c +++ b/sysutils/dmesg.c @@ -5,7 +5,6 @@ #include #include #include -#define BUF_SIZE 8196 int main(int argc, char **argv) { unsigned int s_size = 0;