mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-17 10:35:10 +00:00
Fix if_running not working on linux when a top flavour is not running
This commit is contained in:
parent
08e40c1fe8
commit
75ce3b259b
@ -146,6 +146,9 @@ int top_cpu, top_mem, top_time;
|
|||||||
#ifdef IOSTATS
|
#ifdef IOSTATS
|
||||||
int top_io;
|
int top_io;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __linux__
|
||||||
|
int top_running;
|
||||||
|
#endif
|
||||||
static unsigned int top_name_width = 15;
|
static unsigned int top_name_width = 15;
|
||||||
int output_methods;
|
int output_methods;
|
||||||
static int extra_newline;
|
static int extra_newline;
|
||||||
@ -5053,6 +5056,9 @@ static void set_default_configurations(void)
|
|||||||
#ifdef IOSTATS
|
#ifdef IOSTATS
|
||||||
top_io = 0;
|
top_io = 0;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __linux__
|
||||||
|
top_running = 0;
|
||||||
|
#endif
|
||||||
#ifdef MPD
|
#ifdef MPD
|
||||||
mpd_env_host = getenv("MPD_HOST");
|
mpd_env_host = getenv("MPD_HOST");
|
||||||
mpd_env_port = getenv("MPD_PORT");
|
mpd_env_port = getenv("MPD_PORT");
|
||||||
|
@ -370,6 +370,9 @@ extern int top_cpu, top_mem, top_time;
|
|||||||
#ifdef IOSTATS
|
#ifdef IOSTATS
|
||||||
extern int top_io;
|
extern int top_io;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __linux__
|
||||||
|
extern int top_running;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* defined in conky.c, needed by top.c */
|
/* defined in conky.c, needed by top.c */
|
||||||
extern int cpu_separate;
|
extern int cpu_separate;
|
||||||
|
@ -1124,6 +1124,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
|||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
END OBJ_IF(if_running, INFO_TOP)
|
END OBJ_IF(if_running, INFO_TOP)
|
||||||
if (arg) {
|
if (arg) {
|
||||||
|
top_running = 1;
|
||||||
obj->data.ifblock.s = strndup(arg, text_buffer_size);
|
obj->data.ifblock.s = strndup(arg, text_buffer_size);
|
||||||
#else
|
#else
|
||||||
END OBJ_IF(if_running, 0)
|
END OBJ_IF(if_running, 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user