36 lines
903 B
Text
36 lines
903 B
Text
|
From 6169c48e7815f7e999e23f65c91ab7299f437b7a Mon Sep 17 00:00:00 2001
|
||
|
From: Alan Hicks <ahicks@p-o.co.uk>
|
||
|
Date: Sun, 15 Jan 2017 14:29:20 +0000
|
||
|
Subject: [PATCH 27/27] Allow for systems that don't use proc
|
||
|
|
||
|
---
|
||
|
src/dm_misc.c | 5 +++++
|
||
|
1 file changed, 5 insertions(+)
|
||
|
|
||
|
diff --git src/dm_misc.c src/dm_misc.c
|
||
|
index e795de1..1599c64 100644
|
||
|
--- src/dm_misc.c
|
||
|
+++ src/dm_misc.c
|
||
|
@@ -106,6 +106,10 @@ int drop_privileges(char *newuser, char *newgroup)
|
||
|
|
||
|
int get_opened_fd_count(void)
|
||
|
{
|
||
|
+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__SUNPRO_C)
|
||
|
+ // BSD like systems don't use proc
|
||
|
+ return 0;
|
||
|
+#else
|
||
|
DIR* dir = NULL;
|
||
|
struct dirent* entry = NULL;
|
||
|
char buf[32];
|
||
|
@@ -122,6 +126,7 @@ int get_opened_fd_count(void)
|
||
|
closedir(dir);
|
||
|
|
||
|
return fd_count - 2; /* exclude '.' and '..' entries */
|
||
|
+#endif
|
||
|
}
|
||
|
|
||
|
void create_unique_id(char *target, uint64_t message_idnr)
|
||
|
--
|
||
|
2.10.1 (Apple Git-78)
|
||
|
|