unsigned int *pid_list_size)
{
struct dirent *dirent;
- long read_pid;
+ pid_t read_pid;
while ((dirent = readdir(dir))) {
if (!strcmp(dirent->d_name, ".") ||
continue;
}
- errno = 0;
- read_pid = strtol(dirent->d_name, NULL, 10);
- if (errno) {
- continue;
- }
-
- /*
- * 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) {
+ if (ustcomm_is_socket_live(dirent->d_name, &read_pid)) {
- (*pid_list)[(*pid_list_index)++] = read_pid;
+ (*pid_list)[(*pid_list_index)++] = (long) read_pid;
if (*pid_list_index == *pid_list_size) {
if (realloc_pid_list(pid_list, pid_list_size)) {