[blob] Fallback to copying if mprotect() fails
This commit is contained in:
parent
1aa4666b91
commit
71e735e915
|
@ -348,6 +348,9 @@ hb_blob_try_writable (hb_blob_t *blob)
|
||||||
|
|
||||||
hb_mutex_lock (blob->lock);
|
hb_mutex_lock (blob->lock);
|
||||||
|
|
||||||
|
if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE)
|
||||||
|
_try_writable_inplace_locked (blob);
|
||||||
|
|
||||||
if (blob->mode == HB_MEMORY_MODE_READONLY)
|
if (blob->mode == HB_MEMORY_MODE_READONLY)
|
||||||
{
|
{
|
||||||
char *new_data;
|
char *new_data;
|
||||||
|
@ -373,8 +376,6 @@ hb_blob_try_writable (hb_blob_t *blob)
|
||||||
blob->user_data = new_data;
|
blob->user_data = new_data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE)
|
|
||||||
_try_writable_inplace_locked (blob);
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
mode = blob->mode;
|
mode = blob->mode;
|
||||||
|
|
Loading…
Reference in New Issue