From 5f0aed945861c21e79301fa3fbafda4d428a6b7f Mon Sep 17 00:00:00 2001 From: Sami Vaarala Date: Fri, 11 Feb 2022 15:36:03 +0100 Subject: [PATCH] duk-fuzzilli build fix --- examples/cmdline/duk_cmdline.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/cmdline/duk_cmdline.c b/examples/cmdline/duk_cmdline.c index b1f8d75b..7e349653 100644 --- a/examples/cmdline/duk_cmdline.c +++ b/examples/cmdline/duk_cmdline.c @@ -1373,7 +1373,6 @@ void __sanitizer_cov_reset_edgeguards(void) { } } - void __sanitizer_cov_trace_pc_guard_init(duk_uint32_t *start, duk_uint32_t *stop) { /* Avoid duplicate initialization. */ if (start == stop || *start) { @@ -1394,7 +1393,11 @@ void __sanitizer_cov_trace_pc_guard_init(duk_uint32_t *start, duk_uint32_t *stop puts("[COV] no shared memory bitmap available, skipping"); __shmem = (struct shmem_data *) malloc(SHM_SIZE); } else { +#if defined(S_IRUSR) && defined(S_IWUSR) + int fd = shm_open(shm_key, O_RDWR, S_IRUSR | S_IWUSR); +#else int fd = shm_open(shm_key, O_RDWR, S_IREAD | S_IWRITE); +#endif if (fd <= -1) { fprintf(stderr, "Failed to open shared memory region: %s\n", strerror(errno)); _exit(-1);