ret = pid_to_basename(process->pid, buf);
if (ret) {
- _E("Unable to get process basename: %d", ret);
- return -1;
+ if (ret != -EEXIST)
+ _E("pid_to_basename() failed, pid: %d, ret: %d", process->pid, ret);
+ return ret;
}
process->exe = strndup(buf, NAME_MAX);
/* Create process info */
ret = process_create_info(rd_i->v[0], rd_i->v[1], &process);
if (ret) {
- _E("Unable to create process info: %d", ret);
+ if (ret == -EEXIST)
+ _DD("Unable to create process info, it has just died\n");
+ else
+ _E("Unable to create process info: %d", ret);
+
continue;
}
}
/* Readlink /proc/pid/exe */
ret = readlink(link_name, path, PATH_MAX);
if (ret <= 0) {
- _E("readlink() failed, probably the process(%d) has just died: %d", pid, ret);
- return -1;
+ _DD("readlink() failed, pid: %d, ret: %d\n", pid, ret);
+ return -EEXIST;
}
path[ret] = 0;