Commit 5b7c983a authored by Howard Chu's avatar Howard Chu
Browse files

MacOSX semaphore names are limited to 31 chars

Including the terminating NUL. Good job documenting that, guys.
parent 0533f803
...@@ -2164,7 +2164,7 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) ...@@ -2164,7 +2164,7 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl)
#else /* _WIN32 */ #else /* _WIN32 */
#ifdef __APPLE__ #ifdef __APPLE__
char *ptr; char *ptr;
sprintf(env->me_txns->mti_rmname, "MDBr%.28s", lpath); sprintf(env->me_txns->mti_rmname, "MDBr%.26s", lpath);
ptr = env->me_txns->mti_rmname + sizeof("MDBr")-1; ptr = env->me_txns->mti_rmname + sizeof("MDBr")-1;
while ((ptr = strchr(ptr, '/'))) while ((ptr = strchr(ptr, '/')))
*ptr++ = '_'; *ptr++ = '_';
...@@ -2178,7 +2178,7 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) ...@@ -2178,7 +2178,7 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl)
rc = ErrCode(); rc = ErrCode();
goto fail; goto fail;
} }
sprintf(env->me_txns->mti_wmname, "MDBw%.28s", lpath); sprintf(env->me_txns->mti_wmname, "MDBw%.26s", lpath);
ptr = env->me_txns->mti_wmname + sizeof("MDBw")-1; ptr = env->me_txns->mti_wmname + sizeof("MDBw")-1;
while ((ptr = strchr(ptr, '/'))) while ((ptr = strchr(ptr, '/')))
*ptr++ = '_'; *ptr++ = '_';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment