added error immunity check for the log_write callback

This commit is contained in:
hyunghwan.chung
2018-02-22 04:44:34 +00:00
parent fb3919786f
commit 420ee09907
5 changed files with 49 additions and 17 deletions

View File

@ -978,6 +978,16 @@ enum moo_bcode_t
BCODE_NOOP = 0xFF
};
/* i don't want an error raised inside the callback to override
* the existing error number and message. */
#define vmprim_log_write(moo,mask,ptr,len) do { \
int shuterr = (moo)->shuterr; \
(moo)->shuterr = 1; \
(moo)->vmprim.log_write (moo, mask, ptr, len); \
(moo)->shuterr = shuterr; \
} while(0)
#if defined(__cplusplus)
extern "C" {
#endif