mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-05 21:07:52 +00:00
Merge branch 'master' of git.omp.am:/home/omp/git/conky
This commit is contained in:
commit
f1272dbd31
34
src/proc.c
34
src/proc.c
@ -282,22 +282,26 @@ void print_pid_openfiles(struct text_object *obj, char *p, int p_max_size) {
|
|||||||
struct ll_string* files_back = NULL;
|
struct ll_string* files_back = NULL;
|
||||||
|
|
||||||
dir = opendir(obj->data.s);
|
dir = opendir(obj->data.s);
|
||||||
while ((entry = readdir(dir))) {
|
if(dir != NULL) {
|
||||||
if(entry->d_name[0] != '.') {
|
while ((entry = readdir(dir))) {
|
||||||
snprintf(buf, p_max_size, "%s/%s", obj->data.s, entry->d_name);
|
if(entry->d_name[0] != '.') {
|
||||||
length = readlink(buf, buf, p_max_size);
|
snprintf(buf, p_max_size, "%s/%s", obj->data.s, entry->d_name);
|
||||||
buf[length] = 0;
|
length = readlink(buf, buf, p_max_size);
|
||||||
if(inlist(files_front, buf) == 0) {
|
buf[length] = 0;
|
||||||
files_back = addnode(files_back, buf);
|
if(inlist(files_front, buf) == 0) {
|
||||||
snprintf(p + totallength, p_max_size - totallength, "%s; " , buf);
|
files_back = addnode(files_back, buf);
|
||||||
totallength += length + strlen("; ");
|
snprintf(p + totallength, p_max_size - totallength, "%s; " , buf);
|
||||||
}
|
totallength += length + strlen("; ");
|
||||||
if(files_front == NULL) {
|
}
|
||||||
files_front = files_back;
|
if(files_front == NULL) {
|
||||||
|
files_front = files_back;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
closedir(dir);
|
||||||
|
freelist(files_front);
|
||||||
|
p[totallength - strlen("; ")] = 0;
|
||||||
|
} else {
|
||||||
|
p[0] = 0;
|
||||||
}
|
}
|
||||||
closedir(dir);
|
|
||||||
freelist(files_front);
|
|
||||||
p[totallength - strlen("; ")] = 0;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user