]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
sysdeps-unix: if MSG_NOSIGNAL is available don't touch SIGPIPE by default
authorLennart Poettering <lennart@poettering.net>
Wed, 22 Apr 2009 01:05:39 +0000 (03:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 15 May 2009 18:30:15 +0000 (20:30 +0200)
If we can use MSG_NOSIGNAL we don't have to play games with SIGPIPE

configure.in
dbus/dbus-connection.c

index 9e047eaee19693c5c929319c3a51d4f6a0391df0..88d2164c64a560c0727d8ea4ee8b34c6dbf7bcd8 100644 (file)
@@ -769,6 +769,9 @@ AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
 dnl needed on darwin for NAME_MAX
 AC_CHECK_HEADERS(sys/syslimits.h)
 
+dnl Make it easy to check if we have MSG_NOSIGNAL without actually having to include sys/socket.h
+AC_CHECK_DECLS([MSG_NOSIGNAL], [], [], [[ #include <sys/socket.h> ]])
+
 dnl check for flavours of varargs macros (test from GLib)
 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
 AC_TRY_COMPILE([],[
index 947c0afee75b8323a9f15345f514f5f7f55a21ac..afa0ca6ac19256f698f19af07f8b2f021cbef08e 100644 (file)
@@ -223,7 +223,11 @@ struct DBusPreallocatedSend
   DBusList *counter_link;     /**< Preallocated link in the resource counter */
 };
 
+#ifdef HAVE_DECL_MSG_NOSIGNAL
+static dbus_bool_t _dbus_modify_sigpipe = FALSE;
+#else
 static dbus_bool_t _dbus_modify_sigpipe = TRUE;
+#endif
 
 /**
  * Implementation details of DBusConnection. All fields are private.