eina: fix build on NetBSD.

NOTE: we need a fallback for shm_open that will work on BSD system.


SVN revision: 61324
This commit is contained in:
Cedric BAIL 2011-07-13 08:51:19 +00:00
parent cf4ed126c4
commit 5d21b6699b
3 changed files with 8 additions and 0 deletions

View File

@ -586,6 +586,8 @@ AC_CHECK_FUNCS([openat], [AC_DEFINE(HAVE_OPENAT)], [])
AC_CHECK_FUNCS([statat], [AC_DEFINE(HAVE_STATAT)], [])
AC_CHECK_FUNCS([fpathconf], [AC_DEFINE(HAVE_FPATHCONF)], [])
AC_CHECK_FUNCS([shm_open], [AC_DEFINE(HAVE_SHMOPEN)], [])
### Modules
if test "x${have_default_mempool}" = "xyes" ; then

View File

@ -28,6 +28,8 @@
# include <pthread.h>
#endif
#include <sys/time.h>
#ifdef EINA_HAVE_DEBUG_THREADS
#include <stdlib.h>
#include <string.h>

View File

@ -751,7 +751,11 @@ eina_file_open(const char *filename, Eina_Bool shared)
*/
if (shared)
#ifdef HAVE_SHMOPEN
fd = shm_open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
#else
return NULL;
#endif
else
fd = open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);