summaryrefslogtreecommitdiff
path: root/sysutils/dbus/patches/patch-ab
blob: d344f0f0adb94cb894c093f95f0bd6086280a71d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$NetBSD: patch-ab,v 1.7 2008/02/05 22:03:02 tnn Exp $

--- dbus/dbus-sysdeps-unix.c.orig	2006-12-11 14:21:09.000000000 -0500
+++ dbus/dbus-sysdeps-unix.c
@@ -2311,8 +2311,18 @@ int
 _dbus_printf_string_upper_bound (const char *format,
                                  va_list     args)
 {
+#ifdef __hpux
+/* this code from libnbcompat's vsnprintf */
+  static FILE *devnull = 0;
+  if (!devnull) {
+    devnull = fopen("/dev/null", "w");
+    if (!devnull) return -1;
+  }
+  return vfprintf(devnull, format, args);
+#else
   char c;
   return vsnprintf (&c, 1, format, args);
+#endif
 }
 
 /**