summaryrefslogtreecommitdiff
path: root/ext/fiddle
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fiddle')
-rw-r--r--ext/fiddle/closure.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/fiddle/closure.c b/ext/fiddle/closure.c
index fdb2233b22..d064f11991 100644
--- a/ext/fiddle/closure.c
+++ b/ext/fiddle/closure.c
@@ -228,7 +228,10 @@ initialize(int rbargc, VALUE argv[], VALUE self)
#else
result = ffi_prep_closure(pcl, cif, callback, (void *)self);
cl->code = (void *)pcl;
- mprotect(pcl, sizeof(pcl), PROT_READ | PROT_EXEC);
+ i = mprotect(pcl, sizeof(pcl), PROT_READ | PROT_EXEC);
+ if (i) {
+ rb_sys_fail("mprotect");
+ }
#endif
if (FFI_OK != result)