From 5b7c983a663ee45a3a2f7f05bbe7d294013a06d6 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 14 Sep 2011 20:30:26 -0700 Subject: [PATCH] MacOSX semaphore names are limited to 31 chars Including the terminating NUL. Good job documenting that, guys. --- libraries/libmdb/mdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index d41a362..a336ab8 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -2164,7 +2164,7 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) #else /* _WIN32 */ #ifdef __APPLE__ 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; while ((ptr = strchr(ptr, '/'))) *ptr++ = '_'; @@ -2178,7 +2178,7 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl) rc = ErrCode(); 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; while ((ptr = strchr(ptr, '/'))) *ptr++ = '_';