mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-27 09:08:25 +00:00
fixing execi timing
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@444 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
8413e361ee
commit
04e3c9ec4c
12
src/conky.c
12
src/conky.c
@ -1040,8 +1040,7 @@ static void free_text_objects(unsigned int count, struct text_object *objs)
|
|||||||
free(objs[i].data.tail.logfile);
|
free(objs[i].data.tail.logfile);
|
||||||
free(objs[i].data.tail.buffer);
|
free(objs[i].data.tail.buffer);
|
||||||
break;
|
break;
|
||||||
case OBJ_text:
|
case OBJ_text: case OBJ_font:
|
||||||
case OBJ_font:
|
|
||||||
free(objs[i].data.s);
|
free(objs[i].data.s);
|
||||||
break;
|
break;
|
||||||
case OBJ_exec:
|
case OBJ_exec:
|
||||||
@ -1983,8 +1982,6 @@ static struct text_object_list *extract_variable_text_internal(const char *p)
|
|||||||
obj, sizeof(struct text_object));
|
obj, sizeof(struct text_object));
|
||||||
free(obj);
|
free(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
@ -1999,7 +1996,6 @@ static struct text_object_list *extract_variable_text_internal(const char *p)
|
|||||||
free(obj);
|
free(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p++;
|
p++;
|
||||||
@ -2037,7 +2033,7 @@ static void extract_variable_text(const char *p)
|
|||||||
|
|
||||||
list = extract_variable_text_internal(p);
|
list = extract_variable_text_internal(p);
|
||||||
text_objects = list->text_objects;
|
text_objects = list->text_objects;
|
||||||
text_object_count = list->text_object_count;
|
text_object_count = list->text_object_count;
|
||||||
|
|
||||||
free(list);
|
free(list);
|
||||||
|
|
||||||
@ -2454,7 +2450,7 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
|
|||||||
}
|
}
|
||||||
OBJ(execi) {
|
OBJ(execi) {
|
||||||
char *output = obj->data.execi.buffer;
|
char *output = obj->data.execi.buffer;
|
||||||
if (current_update_time - obj->data.execi.last_update >= obj->data.execi.interval) {
|
if (current_update_time - obj->data.execi.last_update < obj->data.execi.interval) {
|
||||||
char *output = obj->data.execi.buffer;
|
char *output = obj->data.execi.buffer;
|
||||||
FILE *fp = popen(obj->data.execi.cmd, "r");
|
FILE *fp = popen(obj->data.execi.cmd, "r");
|
||||||
int length = fread(output, 1, TEXT_BUFFER_SIZE, fp);
|
int length = fread(output, 1, TEXT_BUFFER_SIZE, fp);
|
||||||
@ -2469,7 +2465,7 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
|
|||||||
}
|
}
|
||||||
OBJ(texeci) {
|
OBJ(texeci) {
|
||||||
static int running = 0;
|
static int running = 0;
|
||||||
if (current_update_time - obj->data.execi.last_update >= obj->data.execi.interval) {
|
if (current_update_time - obj->data.execi.last_update < obj->data.execi.interval) {
|
||||||
static pthread_t execthread;
|
static pthread_t execthread;
|
||||||
if (!running) {
|
if (!running) {
|
||||||
running = 1;
|
running = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user