- if (dirent->d_type != DT_DIR &&
- !!strcmp(dirent->d_name, "ust-consumer")) {
-
- sscanf(dirent->d_name, "%u", (unsigned int *) &ret[i]);
- /* FIXME: Here we previously called pid_is_online, which
- * always returned 1, now I replaced it with just 1.
- * We need to figure out an intelligent way of solving
- * this, maybe connect-disconnect.
- */
- if (1) {
- ret_size += sizeof(pid_t);
- ret = (pid_t *) realloc(ret, ret_size);
- ++i;
- }
+ sscanf(dirent->d_name, "%u", &read_pid);
+
+ (*pid_list)[*pid_list_size - 1] = read_pid;
+ /* FIXME: Here we previously called pid_is_online, which
+ * always returned 1, now I replaced it with just 1.
+ * We need to figure out an intelligent way of solving
+ * this, maybe connect-disconnect.
+ */
+ if (1) {
+ (*pid_list_size)++;
+ *pid_list = realloc(*pid_list,
+ *pid_list_size * sizeof(pid_t));