mirror of https://github.com/xzeldon/htop.git
Linux: fix process parsing for hidden pid directories
This commit is contained in:
parent
5ee6875f73
commit
9549ca8c88
|
@ -1330,12 +1330,12 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_
|
||||||
proc->tgid = parent ? parent->pid : pid;
|
proc->tgid = parent ? parent->pid : pid;
|
||||||
|
|
||||||
#ifdef HAVE_OPENAT
|
#ifdef HAVE_OPENAT
|
||||||
int procFd = openat(dirFd, name, O_PATH | O_DIRECTORY | O_NOFOLLOW);
|
int procFd = openat(dirFd, entry->d_name, O_PATH | O_DIRECTORY | O_NOFOLLOW);
|
||||||
if (procFd < 0)
|
if (procFd < 0)
|
||||||
goto errorReadingProcess;
|
goto errorReadingProcess;
|
||||||
#else
|
#else
|
||||||
char procFd[4096];
|
char procFd[4096];
|
||||||
xSnprintf(procFd, sizeof(procFd), "%s/%s", dirFd, name);
|
xSnprintf(procFd, sizeof(procFd), "%s/%s", dirFd, entry->d_name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LinuxProcessList_recurseProcTree(this, procFd, "task", proc, period, now);
|
LinuxProcessList_recurseProcTree(this, procFd, "task", proc, period, now);
|
||||||
|
|
Loading…
Reference in New Issue