[dconf] workaround OpenBSD mmap() bug
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf] workaround OpenBSD mmap() bug
- Date: Mon, 5 Nov 2012 13:40:56 +0000 (UTC)
commit bcd9ea89be7232d45d40a647660472c1f7ada61e
Author: Antoine Jacoutot <ajacoutot gnome org>
Date: Thu Nov 1 12:17:04 2012 +0100
workaround OpenBSD mmap() bug
On OpenBSD, mapping descriptors PROT_WRITE without also specifying
PROT_READ triggers a segfault.
shm/dconf-shm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/shm/dconf-shm.c b/shm/dconf-shm.c
index 10bfec9..e47e377 100644
--- a/shm/dconf-shm.c
+++ b/shm/dconf-shm.c
@@ -134,7 +134,7 @@ dconf_shm_flag (const gchar *name)
*
* Using mmap() works everywhere.
*/
- shm = mmap (NULL, 1, PROT_WRITE, MAP_SHARED, fd, 0);
+ shm = mmap (NULL, 1, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
g_assert (shm != MAP_FAILED);
*shm = 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]