removed #if's - we now decide at runtime whether to use the server or to
* lib/*.c: removed #if's - we now decide at runtime whether to use the server or to call the appropriate function for the sysdeps directory.
This commit is contained in:
15
lib/cpu.c
15
lib/cpu.c
@@ -23,16 +23,17 @@
|
||||
#include <glibtop/cpu.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
#if GLIBTOP_SUID_CPU
|
||||
|
||||
/* Provides information about cpu usage. */
|
||||
|
||||
void
|
||||
glibtop_get_cpu__l (glibtop *server, glibtop_cpu *buf)
|
||||
{
|
||||
glibtop_init__r (&server);
|
||||
glibtop_call__l (server, GLIBTOP_CMND_CPU, 0, NULL,
|
||||
sizeof (glibtop_cpu), buf);
|
||||
}
|
||||
glibtop_init__r (&server, GLIBTOP_SYSDEPS_CPU, 0);
|
||||
|
||||
#endif
|
||||
if (server->features & GLIBTOP_SYSDEPS_CPU) {
|
||||
glibtop_call__l (server, GLIBTOP_CMND_CPU, 0, NULL,
|
||||
sizeof (glibtop_cpu), buf);
|
||||
} else {
|
||||
glibtop_get_cpu__r (server, buf);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user