summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.in1
-rw-r--r--test/name-test/Makefile.in1
-rw-r--r--test/test-segfault.c18
3 files changed, 17 insertions, 3 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index df19f01b..d8fc34a2 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -624,7 +624,6 @@ DBUS_USER = @DBUS_USER@
DBUS_VERSION = @DBUS_VERSION@
DBUS_X_CFLAGS = @DBUS_X_CFLAGS@
DBUS_X_LIBS = @DBUS_X_LIBS@
-DEFAULT_MESSAGE_UNIX_FDS = @DEFAULT_MESSAGE_UNIX_FDS@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
diff --git a/test/name-test/Makefile.in b/test/name-test/Makefile.in
index 5d037d60..466bd54d 100644
--- a/test/name-test/Makefile.in
+++ b/test/name-test/Makefile.in
@@ -458,7 +458,6 @@ DBUS_USER = @DBUS_USER@
DBUS_VERSION = @DBUS_VERSION@
DBUS_X_CFLAGS = @DBUS_X_CFLAGS@
DBUS_X_LIBS = @DBUS_X_LIBS@
-DEFAULT_MESSAGE_UNIX_FDS = @DEFAULT_MESSAGE_UNIX_FDS@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
diff --git a/test/test-segfault.c b/test/test-segfault.c
index 329a21fd..c062ce1c 100644
--- a/test/test-segfault.c
+++ b/test/test-segfault.c
@@ -9,18 +9,34 @@
#include <sys/resource.h>
#endif
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
+
int
main (int argc, char **argv)
{
char *p;
#if HAVE_SETRLIMIT
+ /* No core dumps please, we know we crashed. */
struct rlimit r = { 0, };
getrlimit (RLIMIT_CORE, &r);
r.rlim_cur = 0;
setrlimit (RLIMIT_CORE, &r);
-
+#endif
+
+#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
+ /* Really, no core dumps please. On Linux, if core_pattern is
+ * set to a pipe (for abrt/apport/corekeeper/etc.), RLIMIT_CORE of 0
+ * is ignored (deliberately, so people can debug init(8) and other
+ * early stuff); but Linux has PR_SET_DUMPABLE, so we can avoid core
+ * dumps anyway. */
+ prctl (PR_SET_DUMPABLE, 0, 0, 0, 0);
+#endif
+
+#ifdef HAVE_RAISE
raise (SIGSEGV);
#endif
p = NULL;