Davidlohr Bueso wrote: +struct proc_tasks *proc_open_tasks(pid_t pid) +{ + struct proc_tasks *tasks; + char path[PATH_MAX]; + + sprintf(path, "/proc/%d/task/", pid); + + tasks = malloc(sizeof(struct proc_tasks)); + if (!tasks) + return NULL; + + tasks->dir = opendir(path); + if (!tasks->dir) + return NULL; + + return tasks; +} shouldn't tasks be freed if opendir fails? +int main(int argc, char *argv[]) +{ + int i = 0; warning: unused variable 'i' Have a nice day, Berny-- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html