cacti-spine: Fix building on NetBSD

This commit is contained in:
nia 2022-05-05 14:31:35 +00:00
parent b57f57af21
commit bd564709e7
3 changed files with 37 additions and 1 deletions

View file

@ -1,7 +1,9 @@
$NetBSD: distinfo,v 1.9 2022/02/20 20:43:31 gavan Exp $
$NetBSD: distinfo,v 1.10 2022/05/05 14:31:35 nia Exp $
BLAKE2s (cacti-spine-1.2.2.tar.gz) = 8f1c26909fdcba748abbb658bd02a0ec92c4784a66e3624a236f3c0415df025b
SHA512 (cacti-spine-1.2.2.tar.gz) = ef2f839f7b247439a8576d49e311546cfd2346eea06cfb26b7a05d4757ae28334e6ed6ea00396027dc6c0c6e107121ed38f356ba62d8202003553fea3b5d139e
Size (cacti-spine-1.2.2.tar.gz) = 2310298 bytes
SHA1 (patch-common.h) = b879113c3330606782bed1ef656f643abce90889
SHA1 (patch-ping.c) = 785c0c6fe7d15b17238b136ba3ae69e8db5a5b49
SHA1 (patch-spine.h) = 87775016517bfae923b619e1cd0bc084b399dbfd
SHA1 (patch-sql.c) = 4effef9bda2c49aeb707c8bc25dfa8cfe520b050

View file

@ -0,0 +1,14 @@
$NetBSD: patch-common.h,v 1.1 2022/05/05 14:31:35 nia Exp $
Uses bool - need to include stdbool.h.
--- common.h.orig 2019-02-24 14:53:23.000000000 +0000
+++ common.h
@@ -90,6 +90,7 @@
#include <semaphore.h>
#include <signal.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <stdio.h>
#include <syslog.h>

View file

@ -0,0 +1,20 @@
$NetBSD: patch-ping.c,v 1.1 2022/05/05 14:31:35 nia Exp $
Horrible hack: NetBSD has gethostbyname_r in libc but it doesn't
actually work.
--- ping.c.orig 2019-02-24 14:53:23.000000000 +0000
+++ ping.c
@@ -34,6 +34,12 @@
#include "common.h"
#include "spine.h"
+#ifdef __NetBSD__
+#undef HAVE_GETHOSTBYNAME_R_GLIBC
+#undef HAVE_GETHOSTBYNAME_R_SOLARIS
+#undef HAVE_GETHOSTBYNAME_R_HPUX
+#endif
+
/*! \fn int ping_host(host_t *host, ping_t *ping)
* \brief ping a host to determine if it is reachable for polling
* \param host a pointer to the current host structure