]> git.sur5r.net Git - openldap/commitdiff
MacOSX semaphore names are limited to 31 chars
authorHoward Chu <hyc@symas.com>
Thu, 15 Sep 2011 03:30:26 +0000 (20:30 -0700)
committerHoward Chu <hyc@symas.com>
Thu, 15 Sep 2011 03:30:26 +0000 (20:30 -0700)
Including the terminating NUL. Good job documenting that, guys.

libraries/libmdb/mdb.c

index d41a36246f76d7dadeab8ed65b041d1fad9f47f9..a336ab8dc2fe00ff3bf7968a92720b988f629e85 100644 (file)
@@ -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++ = '_';