diff options
author | ng0 <ng0@n0.is> | 2019-11-20 13:28:01 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-11-20 13:28:01 +0000 |
commit | 13226e828c6b7d56c77444afe159c1ccf008d62d (patch) | |
tree | 012f078ef372530f02e2ff04e7b8e2cd0149c9e4 /src/testbed | |
parent | 522a4b35a04b2bc8f50b25db8b9a30ef4ab9d9e2 (diff) | |
download | gnunet-13226e828c6b7d56c77444afe159c1ccf008d62d.tar.gz gnunet-13226e828c6b7d56c77444afe159c1ccf008d62d.zip |
follow-up to 7c14b80a011e9e99b1cef0bfd96bae364edd5663:
use __linux__ instead of redefined LINUX.
Diffstat (limited to 'src/testbed')
-rw-r--r-- | src/testbed/gnunet-service-testbed_cpustatus.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/testbed/gnunet-service-testbed_cpustatus.c b/src/testbed/gnunet-service-testbed_cpustatus.c index 5eaeaf952..cd1878467 100644 --- a/src/testbed/gnunet-service-testbed_cpustatus.c +++ b/src/testbed/gnunet-service-testbed_cpustatus.c | |||
@@ -57,7 +57,7 @@ static processor_cpu_load_info_t prev_cpu_load; | |||
57 | 57 | ||
58 | #define DEBUG_STATUSCALLS GNUNET_NO | 58 | #define DEBUG_STATUSCALLS GNUNET_NO |
59 | 59 | ||
60 | #ifdef LINUX | 60 | #ifdef __linux__ |
61 | static FILE *proc_stat; | 61 | static FILE *proc_stat; |
62 | #endif | 62 | #endif |
63 | 63 | ||
@@ -133,7 +133,7 @@ updateUsage () | |||
133 | { | 133 | { |
134 | currentIOLoad = -1; | 134 | currentIOLoad = -1; |
135 | currentCPULoad = -1; | 135 | currentCPULoad = -1; |
136 | #ifdef LINUX | 136 | #ifdef __linux__ |
137 | /* under linux, first try %idle/usage using /proc/stat; | 137 | /* under linux, first try %idle/usage using /proc/stat; |
138 | if that does not work, disable /proc/stat for the future | 138 | if that does not work, disable /proc/stat for the future |
139 | by closing the file and use the next-best method. */ | 139 | by closing the file and use the next-best method. */ |
@@ -509,7 +509,7 @@ mem_get_usage () | |||
509 | } | 509 | } |
510 | 510 | ||
511 | 511 | ||
512 | #ifdef LINUX | 512 | #ifdef __linux__ |
513 | #include <dirent.h> | 513 | #include <dirent.h> |
514 | /** | 514 | /** |
515 | * Returns the number of processes | 515 | * Returns the number of processes |
@@ -557,7 +557,7 @@ sample_load_task (void *cls) | |||
557 | if ((-1 == ld_cpu) || (-1 == ld_disk)) | 557 | if ((-1 == ld_cpu) || (-1 == ld_disk)) |
558 | goto reschedule; | 558 | goto reschedule; |
559 | mem_usage = mem_get_usage (); | 559 | mem_usage = mem_get_usage (); |
560 | #ifdef LINUX | 560 | #ifdef __linux__ |
561 | nproc = get_nproc (); | 561 | nproc = get_nproc (); |
562 | #else | 562 | #else |
563 | nproc = 0; | 563 | nproc = 0; |
@@ -622,7 +622,7 @@ GST_stats_init (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
622 | } | 622 | } |
623 | GNUNET_free (fn); | 623 | GNUNET_free (fn); |
624 | sample_load_task_id = GNUNET_SCHEDULER_add_now (&sample_load_task, NULL); | 624 | sample_load_task_id = GNUNET_SCHEDULER_add_now (&sample_load_task, NULL); |
625 | #ifdef LINUX | 625 | #ifdef __linux__ |
626 | proc_stat = fopen ("/proc/stat", "r"); | 626 | proc_stat = fopen ("/proc/stat", "r"); |
627 | if (NULL == proc_stat) | 627 | if (NULL == proc_stat) |
628 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, | 628 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, |
@@ -642,7 +642,7 @@ GST_stats_destroy () | |||
642 | { | 642 | { |
643 | if (NULL == bw) | 643 | if (NULL == bw) |
644 | return; | 644 | return; |
645 | #ifdef LINUX | 645 | #ifdef __linux__ |
646 | if (proc_stat != NULL) | 646 | if (proc_stat != NULL) |
647 | { | 647 | { |
648 | fclose (proc_stat); | 648 | fclose (proc_stat); |