git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@446
7f574dfc-610e-0410-a909-
a81674777703
+2005-12-14
+ * Fixed issues with execi stuff
+
2005-12-10
* Added sf.net patch 1374576
2005-12-10
* Added sf.net patch 1374576
obj = create_plain_text(s);
if(obj != NULL) {
// allocate memory for the object
obj = create_plain_text(s);
if(obj != NULL) {
// allocate memory for the object
- retval->text_objects = realloc(retval->text_objects,
+ retval->text_objects = realloc(retval->text_objects,
sizeof(struct text_object) * (retval->text_object_count+1));
// assign the new object to the end of the list.
memcpy(&retval->text_objects[retval->text_object_count++],
sizeof(struct text_object) * (retval->text_object_count+1));
// assign the new object to the end of the list.
memcpy(&retval->text_objects[retval->text_object_count++],
- if (current_update_time - obj->data.execi.last_update < obj->data.execi.interval || !obj->data.execi.last_update) {
+ if (current_update_time - obj->data.execi.last_update >= obj->data.execi.interval || !obj->data.execi.last_update) {
new_bar(p, 0, 4, (int) obj->f);
} else {
char *p2 = p;
new_bar(p, 0, 4, (int) obj->f);
} else {
char *p2 = p;
- if (current_update_time - obj->data.execi.last_update < obj->data.execi.interval || !obj->data.execi.last_update) {
+ if (current_update_time - obj->data.execi.last_update >= obj->data.execi.interval || !obj->data.execi.last_update) {
new_graph(p, 0, 25, obj->c, obj->d, (int) (obj->f), 100, 0);
} else {
char *p2 = p;
new_graph(p, 0, 25, obj->c, obj->d, (int) (obj->f), 100, 0);
} else {
char *p2 = p;
}
OBJ(execi) {
char *output = obj->data.execi.buffer;
}
OBJ(execi) {
char *output = obj->data.execi.buffer;
- if (current_update_time - obj->data.execi.last_update < obj->data.execi.interval || !obj->data.execi.last_update) {
+ if (current_update_time - obj->data.execi.last_update >= obj->data.execi.interval || !obj->data.execi.last_update) {
char *output = obj->data.execi.buffer;
FILE *fp = popen(obj->data.execi.cmd, "r");
int length = fread(output, 1, TEXT_BUFFER_SIZE, fp);
char *output = obj->data.execi.buffer;
FILE *fp = popen(obj->data.execi.cmd, "r");
int length = fread(output, 1, TEXT_BUFFER_SIZE, fp);
}
OBJ(texeci) {
static int running = 0;
}
OBJ(texeci) {
static int running = 0;
- if (current_update_time - obj->data.execi.last_update < obj->data.execi.interval || !obj->data.execi.last_update) {
+ if (current_update_time - obj->data.execi.last_update >= obj->data.execi.interval) {
static pthread_t execthread;
static pthread_t execthread;
+ if (running) {
+ pthread_join( execthread, NULL);
+ running = 0;
+ }
if (!running) {
running = 1;
pthread_create( &execthread, NULL, (void*)threaded_exec, (void*) obj);
pthread_mutex_lock( &mutex1 );
obj->data.execi.last_update = current_update_time;
pthread_mutex_unlock( &mutex1 );
if (!running) {
running = 1;
pthread_create( &execthread, NULL, (void*)threaded_exec, (void*) obj);
pthread_mutex_lock( &mutex1 );
obj->data.execi.last_update = current_update_time;
pthread_mutex_unlock( &mutex1 );
- } else {
- pthread_join( execthread, NULL);
- running = 0;
}
}
parse_conky_vars(obj->data.execi.buffer, p, cur);
}
}
parse_conky_vars(obj->data.execi.buffer, p, cur);