[PATCH 2/2] Add OpenBSD support

Federico G. Schwindt fgsch at lodoss.net
Thu Aug 9 03:45:59 CEST 2012


With this all tests but one succeed in OpenBSD.

As I've mentioned on irc, unless msync(2) is called a process reading from the underlying file might not see the same data as the process that mapped that file.
I think having the msync here is harmless and should not affect performance since it's only required at startup but I'm happy to live with an ifdef.

f.-

diff --git a/bin/varnishd/mgt/mgt_shmem.c b/bin/varnishd/mgt/mgt_shmem.c
index 79f8c41..ecce4c1 100644
--- a/bin/varnishd/mgt/mgt_shmem.c
+++ b/bin/varnishd/mgt/mgt_shmem.c
@@ -247,6 +247,9 @@ mgt_SHM_Create(void)
 		(void)unlink(fnbuf);
 		exit (-1);
 	}
+
+	/* Make sure changes are committed. */
+	(void)msync(p, size, MS_SYNC);
 }
 
 /*--------------------------------------------------------------------



More information about the varnish-dev mailing list