| @@ -1,16 +1,16 @@ | | | @@ -1,16 +1,16 @@ |
1 | $NetBSD: patch-ab,v 1.10 2008/06/13 11:28:35 drochner Exp $ | | 1 | $NetBSD: patch-ab,v 1.11 2008/06/14 10:24:52 tnn Exp $ |
2 | | | 2 | |
3 | --- dbus/dbus-sysdeps-unix.c.orig 2008-04-04 11:24:08.000000000 -0400 | | 3 | --- dbus/dbus-sysdeps-unix.c.orig 2008-04-04 17:24:08.000000000 +0200 |
4 | +++ dbus/dbus-sysdeps-unix.c | | 4 | +++ dbus/dbus-sysdeps-unix.c |
5 | @@ -35,6 +35,9 @@ | | 5 | @@ -35,6 +35,9 @@ |
6 | #include "dbus-list.h" | | 6 | #include "dbus-list.h" |
7 | #include "dbus-credentials.h" | | 7 | #include "dbus-credentials.h" |
8 | | | 8 | |
9 | +#ifdef DBUS_USE_NETBSD_ATOMIC_OPS | | 9 | +#ifdef DBUS_USE_NETBSD_ATOMIC_OPS |
10 | +#include <sys/atomic.h> | | 10 | +#include <sys/atomic.h> |
11 | +#endif | | 11 | +#endif |
12 | #include <sys/types.h> | | 12 | #include <sys/types.h> |
13 | #include <stdlib.h> | | 13 | #include <stdlib.h> |
14 | #include <string.h> | | 14 | #include <string.h> |
15 | @@ -786,7 +789,9 @@ _dbus_connect_tcp_socket (const char | | 15 | @@ -786,7 +789,9 @@ _dbus_connect_tcp_socket (const char |
16 | fprintf(stderr, "Family %s\n", family ? family : "none"); | | 16 | fprintf(stderr, "Family %s\n", family ? family : "none"); |
| @@ -52,13 +52,32 @@ $NetBSD: patch-ab,v 1.10 2008/06/13 11:2 | | | @@ -52,13 +52,32 @@ $NetBSD: patch-ab,v 1.10 2008/06/13 11:2 |
52 | +} | | 52 | +} |
53 | +#else | | 53 | +#else |
54 | _DBUS_DEFINE_GLOBAL_LOCK (atomic); | | 54 | _DBUS_DEFINE_GLOBAL_LOCK (atomic); |
55 | | | 55 | |
56 | #if DBUS_USE_ATOMIC_INT_486_COND | | 56 | #if DBUS_USE_ATOMIC_INT_486_COND |
57 | @@ -1818,6 +1839,7 @@ _dbus_atomic_dec (DBusAtomic *atomic) | | 57 | @@ -1818,6 +1839,7 @@ _dbus_atomic_dec (DBusAtomic *atomic) |
58 | return res; | | 58 | return res; |
59 | #endif | | 59 | #endif |
60 | } | | 60 | } |
61 | +#endif /* DBUS_USE_NETBSD_ATOMIC_OPS */ | | 61 | +#endif /* DBUS_USE_NETBSD_ATOMIC_OPS */ |
62 | | | 62 | |
63 | #ifdef DBUS_BUILD_TESTS | | 63 | #ifdef DBUS_BUILD_TESTS |
64 | /** Gets our GID | | 64 | /** Gets our GID |
| | | 65 | @@ -2711,8 +2733,18 @@ int |
| | | 66 | _dbus_printf_string_upper_bound (const char *format, |
| | | 67 | va_list args) |
| | | 68 | { |
| | | 69 | +#if defined(__hpux) || defined(__sgi) |
| | | 70 | +/* this code from libnbcompat's vsnprintf */ |
| | | 71 | + static FILE *devnull = 0; |
| | | 72 | + if (!devnull) { |
| | | 73 | + devnull = fopen("/dev/null", "w"); |
| | | 74 | + if (!devnull) return -1; |
| | | 75 | + } |
| | | 76 | + return vfprintf(devnull, format, args); |
| | | 77 | +#else |
| | | 78 | char c; |
| | | 79 | return vsnprintf (&c, 1, format, args); |
| | | 80 | +#endif |
| | | 81 | } |
| | | 82 | |
| | | 83 | /** |