summaryrefslogtreecommitdiff
path: root/sysutils/lttng-tools/files/patch-src_common_compat_compat-epoll.c
blob: 40b4437d529a258df1f7bfab805e484668488b1c (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
--- src/common/compat/compat-epoll.c.orig	2017-01-13 22:20:45 UTC
+++ src/common/compat/compat-epoll.c
@@ -31,7 +31,11 @@
 
 #include "poll.h"
 
-unsigned int poll_max_size;
+unsigned int poll_max_size
+#if defined(__FreeBSD__)
+= DEFAULT_POLL_SIZE
+#endif
+;
 
 /*
  * Resize the epoll events structure of the new size.
@@ -258,6 +262,7 @@ int compat_epoll_set_max_size(void)
 	ssize_t size_ret;
 	char buf[64];
 
+#if !defined(__FreeBSD__)
 	fd = open(COMPAT_EPOLL_PROC_PATH, O_RDONLY);
 	if (fd < 0) {
 		retval = -1;
@@ -282,8 +287,10 @@ end_read:
 		PERROR("close");
 	}
 end:
+#endif
 	if (!poll_max_size) {
 		poll_max_size = DEFAULT_POLL_SIZE;
+		retval = 0;
 	}
 	DBG("epoll set max size is %d", poll_max_size);
 	return retval;