Lines 1-5
Link Here
|
1 |
--- lib/utils.c.orig 2015-01-27 23:13:50.000000000 -0500 |
1 |
--- lib/utils.c.orig 2016-01-08 11:43:49 UTC |
2 |
+++ lib/utils.c 2015-01-27 23:18:04.000000000 -0500 |
2 |
+++ lib/utils.c |
3 |
@@ -43,6 +43,16 @@ |
3 |
@@ -43,6 +43,16 @@ |
4 |
|
4 |
|
5 |
#include <event2/util.h> |
5 |
#include <event2/util.h> |
Lines 17-23
Link Here
|
17 |
extern int inet_pton(int af, const char *src, void *dst); |
17 |
extern int inet_pton(int af, const char *src, void *dst); |
18 |
|
18 |
|
19 |
|
19 |
|
20 |
@@ -1465,14 +1475,20 @@ |
20 |
@@ -1469,14 +1479,20 @@ get_argv_utf8 (int *argc) |
21 |
} |
21 |
} |
22 |
#endif /* ifdef WIN32 */ |
22 |
#endif /* ifdef WIN32 */ |
23 |
|
23 |
|
Lines 40-46
Link Here
|
40 |
return -1; |
40 |
return -1; |
41 |
} |
41 |
} |
42 |
|
42 |
|
43 |
@@ -1496,7 +1512,8 @@ |
43 |
@@ -1500,7 +1516,8 @@ find_process_in_dirent(struct dirent *di |
44 |
} |
44 |
} |
45 |
|
45 |
|
46 |
/* read the /proc fs to determine whether some process is running */ |
46 |
/* read the /proc fs to determine whether some process is running */ |
Lines 50-56
Link Here
|
50 |
{ |
50 |
{ |
51 |
DIR *proc_dir = opendir("/proc"); |
51 |
DIR *proc_dir = opendir("/proc"); |
52 |
if (!proc_dir) { |
52 |
if (!proc_dir) { |
53 |
@@ -1510,7 +1527,7 @@ |
53 |
@@ -1514,7 +1531,7 @@ gboolean process_is_running (const char |
54 |
/* /proc/[1-9][0-9]* */ |
54 |
/* /proc/[1-9][0-9]* */ |
55 |
if (first > '9' || first < '1') |
55 |
if (first > '9' || first < '1') |
56 |
continue; |
56 |
continue; |
Lines 59-65
Link Here
|
59 |
if (pid > 0) { |
59 |
if (pid > 0) { |
60 |
closedir(proc_dir); |
60 |
closedir(proc_dir); |
61 |
return TRUE; |
61 |
return TRUE; |
62 |
@@ -1520,6 +1537,18 @@ |
62 |
@@ -1524,6 +1541,18 @@ gboolean process_is_running (const char |
63 |
closedir(proc_dir); |
63 |
closedir(proc_dir); |
64 |
return FALSE; |
64 |
return FALSE; |
65 |
} |
65 |
} |
Lines 78-91
Link Here
|
78 |
#endif |
78 |
#endif |
79 |
|
79 |
|
80 |
#ifdef __APPLE__ |
80 |
#ifdef __APPLE__ |
81 |
@@ -1530,6 +1559,108 @@ |
81 |
@@ -1534,6 +1563,113 @@ gboolean process_is_running (const char |
82 |
} |
82 |
} |
83 |
#endif |
83 |
#endif |
84 |
|
84 |
|
85 |
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) |
85 |
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) |
86 |
+#if defined(__FreeBSD__) |
86 |
+#if defined(__FreeBSD__) |
|
|
87 |
+#if __FreeBSD_version < 1100097 |
87 |
+#define PSKIP(kp) ((kp)->ki_pid == mypid || \ |
88 |
+#define PSKIP(kp) ((kp)->ki_pid == mypid || \ |
88 |
+ (!kthreads && ((kp)->ki_flag & P_KTHREAD) != 0)) |
89 |
+ (!kthreads && ((kp)->ki_flag & P_KTHREAD) != 0)) |
|
|
90 |
+#else |
91 |
+#define PSKIP(kp) ((kp)->ki_pid == mypid || \ |
92 |
+ (!kthreads && ((kp)->ki_flag & P_KPROC) != 0)) |
93 |
+#endif |
89 |
+#define KVM_OPENFILES(exec, coref, buf) \ |
94 |
+#define KVM_OPENFILES(exec, coref, buf) \ |
90 |
+ kvm_openfiles(exec, coref, NULL, O_RDONLY, buf) |
95 |
+ kvm_openfiles(exec, coref, NULL, O_RDONLY, buf) |
91 |
+#define KVM_GETPROCS(kd, plist, nproc) \ |
96 |
+#define KVM_GETPROCS(kd, plist, nproc) \ |