]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix build
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 16 Oct 2018 13:23:39 +0000 (14:23 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 16 Oct 2018 13:23:39 +0000 (14:23 +0100)
src/rspamd.c

index 4cf9ff28790c19d04d56ba5892ef23dafb9df420..09523b90c39e3c72f02ee5aa6c6c1a0bdea4dc78 100644 (file)
@@ -43,6 +43,9 @@
 #ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
 #endif
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
 #ifdef HAVE_LIBUTIL_H
 #include <libutil.h>
 #endif
@@ -1028,6 +1031,7 @@ rspamd_cld_handler (gint signo, short what, gpointer arg)
                                                                g_strsignal (WTERMSIG (res)));
                                        }
                                        else {
+#ifdef HAVE_SYS_RESOURCE_H
                                                struct rlimit rlmt;
                                                (void)getrlimit (RLIMIT_CORE, &rlmt);
 
@@ -1041,6 +1045,15 @@ rspamd_cld_handler (gint signo, short what, gpointer arg)
                                                                cur->cores_throttled ? "yes" : "no",
                                                                (gint64)rlmt.rlim_cur,
                                                                (gint64)rlmt.rlim_max);
+#else
+                                               msg_warn_main (
+                                                               "%s process %P terminated abnormally by signal: %s"
+                                                               " but NOT created core file (throttled=%s); ",
+                                                               g_quark_to_string (cur->type),
+                                                               cur->pid,
+                                                               g_strsignal (WTERMSIG (res)),
+                                                               cur->cores_throttled ? "yes" : "no");
+#endif
                                        }
 #else
                                        msg_warn_main (