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
|
$NetBSD: patch-ab,v 1.10 2008/06/13 11:28:35 drochner Exp $
--- dbus/dbus-sysdeps-unix.c.orig 2008-04-04 11:24:08.000000000 -0400
+++ dbus/dbus-sysdeps-unix.c
@@ -35,6 +35,9 @@
#include "dbus-list.h"
#include "dbus-credentials.h"
+#ifdef DBUS_USE_NETBSD_ATOMIC_OPS
+#include <sys/atomic.h>
+#endif
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
@@ -786,7 +789,9 @@ _dbus_connect_tcp_socket (const char
fprintf(stderr, "Family %s\n", family ? family : "none");
hints.ai_protocol = IPPROTO_TCP;
hints.ai_socktype = SOCK_STREAM;
+#ifdef AI_ADDRCONFIG
hints.ai_flags = AI_ADDRCONFIG;
+#endif
if ((res = getaddrinfo(host, port, &hints, &ai)) != 0)
{
@@ -889,7 +894,11 @@ _dbus_listen_tcp_socket (const char
hints.ai_protocol = IPPROTO_TCP;
hints.ai_socktype = SOCK_STREAM;
+#ifdef AI_ADDRCONFIG
hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE;
+#else
+ hints.ai_flags = AI_PASSIVE;
+#endif
redo_lookup_with_port:
if ((res = getaddrinfo(host, port, &hints, &ai)) != 0 || !ai)
@@ -1753,7 +1762,19 @@ _dbus_parse_uid (const DBusString *
return TRUE;
}
+#ifdef DBUS_USE_NETBSD_ATOMIC_OPS
+dbus_int32_t
+_dbus_atomic_inc (DBusAtomic *atomic)
+{
+ return (atomic_inc_32_nv(DBusAtomic));
+}
+dbus_int32_t
+_dbus_atomic_dec (DBusAtomic *atomic)
+{
+ return (atomic_dec_32_nv(DBusAtomic));
+}
+#else
_DBUS_DEFINE_GLOBAL_LOCK (atomic);
#if DBUS_USE_ATOMIC_INT_486_COND
@@ -1818,6 +1839,7 @@ _dbus_atomic_dec (DBusAtomic *atomic)
return res;
#endif
}
+#endif /* DBUS_USE_NETBSD_ATOMIC_OPS */
#ifdef DBUS_BUILD_TESTS
/** Gets our GID
|