diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-06-09 10:55:22 +0200 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-06-09 22:52:18 +0200 |
commit | faabbaa71ec09c0dc8a013f412b38726eec4e899 (patch) | |
tree | 2b9aa30a04cbd563a4787fe96b36def1cd4c5786 /linux/LinuxProcessList.c | |
parent | 8154125d4bf26fff20241eebe17954254409a522 (diff) |
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
Diffstat (limited to 'linux/LinuxProcessList.c')
-rw-r--r-- | linux/LinuxProcessList.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 1c5359fc..fdde57c3 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -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 |