aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/0101-drop-o-path-usage.patch
blob: 969d727a1510e700f31a6d6bc75cb58c9c763e2d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From d8e81ab747e96cb687e8d6981ef4a0fb58050884 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Wed, 9 Jun 2021 10:55:22 +0200
Subject: [PATCH] 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
---
 linux/LinuxProcessList.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -58,12 +58,6 @@
 #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 @@
       proc->tgid = parent ? parent->pid : pid;
 
 #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

© 2014-2024 Faster IT GmbH | imprint | privacy policy