logrotate: fix build on NetBSD

(no secure_getenv function)
This commit is contained in:
wiz 2020-10-08 07:50:51 +00:00
parent b02cc94418
commit b845ccd3ea
2 changed files with 9 additions and 5 deletions

View file

@ -1,10 +1,10 @@
$NetBSD: distinfo,v 1.18 2020/10/01 20:14:56 nils Exp $
$NetBSD: distinfo,v 1.19 2020/10/08 07:50:51 wiz Exp $
SHA1 (logrotate-3.17.0.tar.gz) = 143fcf6010ff32cfb0a13ea49df22cb383843b63
RMD160 (logrotate-3.17.0.tar.gz) = d79e0e2c03bc47e970acd28875cebf045635f33a
SHA512 (logrotate-3.17.0.tar.gz) = ada4415ef68ad97c1415fa0c1ba7bf108621777cd91599bf4f999dea1c1025596543aa00fd579cae4d39315b71c4d8f96a9c9d1178f78be7c523470588ab1d31
Size (logrotate-3.17.0.tar.gz) = 224559 bytes
SHA1 (patch-config.c) = 2064e2e1186305eaea1b3597a634d57c04cc4fc4
SHA1 (patch-config.c) = 5f967ff8479c78628e62e23e200c6373aebd0786
SHA1 (patch-configure.ac) = 3d9d232f386b286288ba0f543804d10feeb306cf
SHA1 (patch-examples_logrotate.conf) = 4d0aad215e66850e8ae1a005764f8bd109fb76c9
SHA1 (patch-examples_logrotate.cron) = 31a19e1b697e945299bbbe6701674d886379a49c

View file

@ -1,16 +1,20 @@
$NetBSD: patch-config.c,v 1.6 2019/03/20 10:34:10 he Exp $
$NetBSD: patch-config.c,v 1.7 2020/10/08 07:50:51 wiz Exp $
Fix NetBSD compilation.
--- config.c.orig 2016-12-02 13:12:33.000000000 +0000
--- config.c.orig 2020-07-10 08:22:39.000000000 +0000
+++ config.c
@@ -23,7 +23,9 @@
@@ -19,7 +19,13 @@
#include <wctype.h>
#include <fnmatch.h>
#include <sys/mman.h>
-#include <libgen.h>
+#ifndef _LIBGEN_H_
+# include <libgen.h>
+#endif
+
+#ifndef secure_getenv
+#define secure_getenv getenv
+#endif
#if !defined(PATH_MAX) && defined(__FreeBSD__)