[daemon-fix] Registering starters: unwanted release_kdbus_name when no error was...
[platform/upstream/dbus.git] / test / test-segfault.c
index 94b4274..329a21f 100644 (file)
@@ -1,14 +1,20 @@
 /* This is simply a process that segfaults */
+#include <config.h>
+#include <stdlib.h>
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
+#endif
 
-#include <sys/time.h>
+#ifdef HAVE_SETRLIMIT
 #include <sys/resource.h>
+#endif
 
 int
 main (int argc, char **argv)
 {
   char *p;  
 
+#if HAVE_SETRLIMIT
   struct rlimit r = { 0, };
   
   getrlimit (RLIMIT_CORE, &r);
@@ -16,8 +22,8 @@ main (int argc, char **argv)
   setrlimit (RLIMIT_CORE, &r);
   
   raise (SIGSEGV);
-
-  p = 0;
+#endif
+  p = NULL;
   *p = 'a';
   
   return 0;