From: Howard Chu Date: Thu, 7 Aug 2014 18:06:53 +0000 (-0700) Subject: Just use memalign, not posix_memalign X-Git-Tag: accepted/tizen/5.0/unified/20181102.030725~325 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ada26306992babeccad0c5443fbd76e28dd24cd6;p=platform%2Fupstream%2Flmdb.git Just use memalign, not posix_memalign Everything has it. Solaris doesn't have posix_memalign. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 8b560ed..6a95f31 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -85,6 +85,7 @@ extern int cacheflush(char *addr, int nbytes, int cache); #include #include #include +#include #include #include #include @@ -8469,9 +8470,9 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd) #else pthread_mutex_init(&my.mc_mutex, NULL); pthread_cond_init(&my.mc_cond, NULL); - rc = posix_memalign((void **)&my.mc_wbuf[0], env->me_os_psize, MDB_WBUF*2); - if (rc) - return rc; + my.mc_wbuf[0] = memalign(env->me_os_psize, MDB_WBUF*2); + if (my.mc_wbuf[0] == NULL) + return errno; #endif memset(my.mc_wbuf[0], 0, MDB_WBUF*2); my.mc_wbuf[1] = my.mc_wbuf[0] + MDB_WBUF;