Merge pull request #6 from jbeich/freebsd

Unbreak shared memory on FreeBSD
This commit is contained in:
cyclopsian 2019-10-05 01:27:27 +00:00 committed by GitHub
commit a3d3d13a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,6 +36,7 @@
#include <stdarg.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
@ -190,7 +191,7 @@ static int create_shm_file(size_t size, const char *fmt, ...) {
return -1;
}
fd = shm_open(shm_name, O_CREAT | O_RDWR, 0);
fd = shm_open(shm_name, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
if (fd == -1) {
fprintf(stderr, "shm_open: %s\n", strerror(errno));
free(shm_name);