[master] c9705a90b openbsd: MAP_NOCORE equivalent and fixing build.
Poul-Henning Kamp
phk at FreeBSD.org
Mon Aug 26 07:54:07 UTC 2019
commit c9705a90b8962055ca50f1d796118699bc0493da
Author: David Carlier <devnexen at gmail.com>
Date: Sun Aug 25 16:04:08 2019 +0100
openbsd: MAP_NOCORE equivalent and fixing build.
diff --git a/bin/varnishd/storage/mgt_storage_persistent.c b/bin/varnishd/storage/mgt_storage_persistent.c
index e2fbf1c0f..40d5d7233 100644
--- a/bin/varnishd/storage/mgt_storage_persistent.c
+++ b/bin/varnishd/storage/mgt_storage_persistent.c
@@ -55,8 +55,12 @@
#endif
#ifndef MAP_NOCORE
+#ifdef MAP_CONCEAL
+#define MAP_NOCORE MAP_CONCEAL /* XXX OpenBSD */
+#else
#define MAP_NOCORE 0 /* XXX Linux */
#endif
+#endif
#ifndef MAP_NOSYNC
#define MAP_NOSYNC 0 /* XXX Linux */
diff --git a/bin/varnishd/storage/storage_file.c b/bin/varnishd/storage/storage_file.c
index 78588ccab..7e0c0a2ae 100644
--- a/bin/varnishd/storage/storage_file.c
+++ b/bin/varnishd/storage/storage_file.c
@@ -48,8 +48,12 @@
#include "VSC_smf.h"
#ifndef MAP_NOCORE
+#ifdef MAP_CONCEAL
+#define MAP_NOCORE MAP_CONCEAL /* XXX OpenBSD */
+#else
#define MAP_NOCORE 0 /* XXX Linux */
#endif
+#endif
#ifndef MAP_NOSYNC
#define MAP_NOSYNC 0 /* XXX Linux */
diff --git a/lib/libvmod_unix/cred_compat.h b/lib/libvmod_unix/cred_compat.h
index fe3a5b9ff..6512d2122 100644
--- a/lib/libvmod_unix/cred_compat.h
+++ b/lib/libvmod_unix/cred_compat.h
@@ -68,8 +68,13 @@ get_ids(int fd, uid_t *uid, gid_t *gid)
{
#if defined(SO_PEERCRED)
+#if defined(__OpenBSD__)
+ typedef struct sockpeercred ucred_t;
+#else
+ typedef struct ucred ucred_t;
+#endif
- struct ucred ucred;
+ ucred_t ucred;
socklen_t l = sizeof(ucred);
errno = 0;
More information about the varnish-commit
mailing list