[blob] Fallback to copying if mprotect() fails

This commit is contained in:
Behdad Esfahbod 2010-04-23 13:48:06 -04:00
parent 1aa4666b91
commit 71e735e915
1 changed files with 3 additions and 2 deletions

View File

@ -348,6 +348,9 @@ hb_blob_try_writable (hb_blob_t *blob)
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)
{
char *new_data;
@ -373,8 +376,6 @@ hb_blob_try_writable (hb_blob_t *blob)
blob->user_data = new_data;
}
}
else if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE)
_try_writable_inplace_locked (blob);
done:
mode = blob->mode;