Fix SDL2 driver arguments to mmap() and sem_open()
Linux & MacOS seem to tolerate the incorrect parameters but they are wrong as per the documentation. On more pedantic systems such as FreeBSD these calls fails.
This commit is contained in:
parent
4261a1fb0b
commit
1c29a88ee1
@ -174,8 +174,8 @@ static struct SDL_UGFXContext *context;
|
|||||||
static sem_t *ctx_mutex;
|
static sem_t *ctx_mutex;
|
||||||
static sem_t *input_event;
|
static sem_t *input_event;
|
||||||
|
|
||||||
#define CTX_MUTEX_NAME "ugfx_ctx_mutex"
|
#define CTX_MUTEX_NAME "/ugfx_ctx_mutex"
|
||||||
#define INPUT_EVENT_NAME "ugfx_input_event"
|
#define INPUT_EVENT_NAME "/ugfx_input_event"
|
||||||
|
|
||||||
|
|
||||||
static int SDL_loop (void) {
|
static int SDL_loop (void) {
|
||||||
@ -316,7 +316,7 @@ void sdl_driver_init (void) {
|
|||||||
exit (1) ;
|
exit (1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((context = (struct SDL_UGFXContext*) mmap (0,sizeof (struct SDL_UGFXContext ),PROT_WRITE|PROT_READ,(MAP_ANONYMOUS | MAP_SHARED),0,0)) ==MAP_FAILED) {
|
if ((context = (struct SDL_UGFXContext*) mmap (0, sizeof(struct SDL_UGFXContext), PROT_WRITE|PROT_READ, (MAP_ANONYMOUS | MAP_SHARED), -1, 0)) == MAP_FAILED) {
|
||||||
perror("Failed to allocate shared memory");
|
perror("Failed to allocate shared memory");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user