diff --git a/source/snd_linux.c b/source/snd_linux.c index 9aaf61f..ab0996c 100644 --- a/source/snd_linux.c +++ b/source/snd_linux.c @@ -38,6 +38,10 @@ #include #include "quakedef.h" +#ifndef MAP_FAILED +# define MAP_FAILED ((void *) -1) +#endif + int audio_fd; int snd_inited; @@ -140,8 +144,7 @@ qboolean SNDDMA_Init(void) shm->buffer = (unsigned char *) mmap(NULL, info.fragstotal * info.fragsize, PROT_WRITE, MAP_FILE|MAP_SHARED, audio_fd, 0); - if (!shm->buffer) - { + if (shm->buffer == MAP_FAILED) { perror("/dev/dsp"); Con_Printf("Could not mmap /dev/dsp\n"); close(audio_fd);