summaryrefslogtreecommitdiffstats
path: root/src/common.c
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2016-12-05 22:10:59 +0200
committerVladimir Kobal <vlad@prokk.net>2016-12-05 22:10:59 +0200
commit331ae4c0caccff0df4abac224de94c969b6f35cd (patch)
treeb135e7353fe3765ca687db11bb9fc294c347ea83 /src/common.c
parent2ebb9ab48f89c573ce4e051c42ef08c4200f686c (diff)
Minor cleanups and plugin structure changes
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/common.c b/src/common.c
index 29669d9309..98093b965c 100644
--- a/src/common.c
+++ b/src/common.c
@@ -1,9 +1,8 @@
#include "common.h"
-#ifdef __FreeBSD__
-# include <sys/thr.h>
-# define O_NOATIME 0
-# define MADV_DONTFORK INHERIT_NONE
+#ifdef __FreeBSD__
+# define O_NOATIME 0
+# define MADV_DONTFORK INHERIT_NONE
#endif /* __FreeBSD__ */
char *global_host_prefix = "";
@@ -1031,11 +1030,9 @@ int fd_is_valid(int fd) {
}
pid_t gettid(void) {
-#ifdef __FreeBSD__
- long pid;
- thr_self( &pid );
- return (unsigned) pid;
-#else /* __FreeBSD__ */
+#ifdef __FreeBSD__
+ return (pid_t)pthread_getthreadid_np();
+#else
return (pid_t)syscall(SYS_gettid);
#endif /* __FreeBSD__ */
}