summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-09-27 03:42:08 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-09-27 03:42:08 +0000
commit26024088829a36698c57bf0b05dfc34f42adfc54 (patch)
tree347cbbdb803c4b4023c17125da00addc60186f44
parentbf41a5e786002f2b635921e65c63e2b1af5b3c8b (diff)
backport mmap safety fix.
SVN revision: 77114
-rw-r--r--ChangeLog9
-rw-r--r--NEWS9
-rw-r--r--src/lib/eina_mmap.c11
3 files changed, 23 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index fc57f4f..67c027e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
12011-01-29 Carsten Haitzler (The Rasterman) 1]2011-01-29 Carsten Haitzler (The Rasterman)
2 2
3 1.0.0 release 3 1.0.0 release
4 4
@@ -339,3 +339,10 @@
339 * Add check if given arguments (distance and coordinates) in eina_tiler 339 * Add check if given arguments (distance and coordinates) in eina_tiler
340 and eina_rectangle are not below zero 340 and eina_rectangle are not below zero
341 * Documentation for eina list specified and eina stringshare fixed 341 * Documentation for eina list specified and eina stringshare fixed
342
3432012-09-27 Carsten Haitzler (The Rasterman)
344
345 * Fix return value of eina_mmap_safety_enabled_set() and
346 ensure future eina_mmap_safety_enabled_get() return right value
347 on success.
348
diff --git a/NEWS b/NEWS
index a17ec50..27fd1ab 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,11 @@
1Eina 1.7.0 1Eina 1.7.1
2
3Changes since Eina 1.7.0:
4-------------------------
5
6Fixes:
7 * Fix return value of eina_mmap_safety_enabled_set() and future
8 eina_mmap_safety_enabled_get() returns after success
2 9
3Changes since Eina 1.2.0: 10Changes since Eina 1.2.0:
4------------------------- 11-------------------------
diff --git a/src/lib/eina_mmap.c b/src/lib/eina_mmap.c
index b99a542..90809a2 100644
--- a/src/lib/eina_mmap.c
+++ b/src/lib/eina_mmap.c
@@ -164,10 +164,7 @@ eina_mmap_safety_enabled_set(Eina_Bool enabled)
164 sa.sa_sigaction = _eina_mmap_safe_sigbus; 164 sa.sa_sigaction = _eina_mmap_safe_sigbus;
165 sa.sa_flags = SA_RESTART | SA_SIGINFO; 165 sa.sa_flags = SA_RESTART | SA_SIGINFO;
166 sigemptyset(&sa.sa_mask); 166 sigemptyset(&sa.sa_mask);
167 /* FIXME: This is rubbish. We return EINA_FALSE whether sigaction 167 if (sigaction(SIGBUS, &sa, NULL) == 0) goto done;
168 * fails or not. And we never set mmap_safe, so we always hit this
169 * code path. */
170 if (sigaction(SIGBUS, &sa, NULL) == 0) return EINA_FALSE;
171 /* setup of SIGBUS handler failed, lets close zero page dev and fail */ 168 /* setup of SIGBUS handler failed, lets close zero page dev and fail */
172 close(_eina_mmap_zero_fd); 169 close(_eina_mmap_zero_fd);
173 _eina_mmap_zero_fd = -1; 170 _eina_mmap_zero_fd = -1;
@@ -176,8 +173,14 @@ eina_mmap_safety_enabled_set(Eina_Bool enabled)
176 else 173 else
177 { 174 {
178 /* reset signal handler to default for SIGBUS */ 175 /* reset signal handler to default for SIGBUS */
176 if (_eina_mmap_zero_fd >= 0)
177 {
178 close(_eina_mmap_zero_fd);
179 _eina_mmap_zero_fd = -1;
180 }
179 signal(SIGBUS, SIG_DFL); 181 signal(SIGBUS, SIG_DFL);
180 } 182 }
183done:
181 mmap_safe = enabled; 184 mmap_safe = enabled;
182 return mmap_safe; 185 return mmap_safe;
183#endif 186#endif