aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/0003-fix-hurd-build.patch
blob: f4690c56c2c6ecbb8d9d3531a7573cf33773404c (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
commit ecfe8794dc705d5ceaf8202c7cab73f3457d4d48 (HEAD -> fix-hurd-build, gh-fit/fix-hurd-build)
Author: Daniel Lange <DLange@git.local>
Date:   Thu Jan 14 13:27:47 2021 +0100

    Define PATH_MAX for GNU/hurd

    Otherwise fails with
    "> linux/LinuxProcessList.c:889:20: error: ‘PATH_MAX’ undeclared (first use in this function)"

--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -14,7 +14,6 @@
 #include <dirent.h>
 #include <fcntl.h>
 #include <inttypes.h>
-#include <limits.h>
 #include <math.h>
 #include <stdint.h>
 #include <stdio.h>
--- a/linux/Platform.h
+++ b/linux/Platform.h
@@ -7,6 +7,7 @@
 in the source distribution for its full text.
 */
 
+#include <limits.h>
 #include <stdbool.h>
 #include <sys/types.h>
 
@@ -18,6 +19,12 @@
 #include "ProcessLocksScreen.h"
 #include "SignalsPanel.h"
 
+/* GNU/Hurd does not have PATH_MAX in limits.h */
+#ifndef PATH_MAX
+   #define PATH_MAX 4096
+#endif
+
+
 extern const ProcessField Platform_defaultFields[];
 
 extern const SignalItem Platform_signals[];
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -42,6 +42,7 @@
 #include "LinuxProcess.h"
 #include "Macros.h"
 #include "Object.h"
+#include "Platform.h" // needed for GNU/hurd to get PATH_MAX
 #include "Process.h"
 #include "Settings.h"
 #include "XUtils.h"
--- a/linux/SELinuxMeter.c
+++ b/linux/SELinuxMeter.c
@@ -12,7 +12,6 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <unistd.h>
-#include <linux/magic.h>
 #include <sys/statfs.h>
 #include <sys/statvfs.h>
 
@@ -35,7 +34,7 @@
       return false;
    }
 
-   if ((uint32_t)sfbuf.f_type != (uint32_t)SELINUX_MAGIC) {
+   if ((uint32_t)sfbuf.f_type != /* SELINUX_MAGIC */ 0xf97cff8cU) {
       return false;
    }
 

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