mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Linux: drop O_PATH usage
O_PATH is available since Linux 2.6.39, but we are using fstat(2) on the returned file descriptor in LinuxProcessList_statProcessDir(), which is only supported since Linux 3.6. Fixes #534
This commit is contained in:
parent
8154125d4b
commit
faabbaa71e
@ -60,12 +60,6 @@ in the source distribution for its full text.
|
||||
#endif
|
||||
|
||||
|
||||
// CentOS 6's kernel doesn't provide a definition of O_PATH
|
||||
// based on definition taken from uapi/asm-generic/fcnth.h in Linux kernel tree
|
||||
#ifndef O_PATH
|
||||
# define O_PATH 010000000
|
||||
#endif
|
||||
|
||||
static long long btime = -1;
|
||||
|
||||
static long jiffy;
|
||||
@ -1313,7 +1307,7 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_
|
||||
proc->isUserlandThread = proc->pid != proc->tgid;
|
||||
|
||||
#ifdef HAVE_OPENAT
|
||||
int procFd = openat(dirFd, entry->d_name, O_PATH | O_DIRECTORY | O_NOFOLLOW);
|
||||
int procFd = openat(dirFd, entry->d_name, O_RDONLY | O_DIRECTORY | O_NOFOLLOW);
|
||||
if (procFd < 0)
|
||||
goto errorReadingProcess;
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user