--- freem/src/symtab_bltin.c 2025/04/13 04:22:43 1.11 +++ freem/src/symtab_bltin.c 2025/04/14 19:56:27 1.12 @@ -1,5 +1,5 @@ /* - * $Id: symtab_bltin.c,v 1.11 2025/04/13 04:22:43 snw Exp $ + * $Id: symtab_bltin.c,v 1.12 2025/04/14 19:56:27 snw Exp $ * FreeM local system table and user-defined special variable table * * @@ -24,6 +24,9 @@ * along with FreeM. If not, see . * * $Log: symtab_bltin.c,v $ + * Revision 1.12 2025/04/14 19:56:27 snw + * Working towards FreeBSD fix + * * Revision 1.11 2025/04/13 04:22:43 snw * Fix snprintf calls * @@ -163,13 +166,12 @@ void symtab_init (void) mbpartition = (char *) shm_alloc ((size_t) PSIZE + 2); if (mbpartition != NULL) { shm_config->hdr->use_mb_globals = TRUE; + shm_config->hdr->partition = mbpartition; } else { fprintf (stderr, "symtab_init: falling back to global-backed structured system variables\r\n"); shm_config->hdr->use_mb_globals = FALSE; } - - shm_config->hdr->partition = mbpartition; if (symtab_get_sem ()) { for (i = 0; i < 128; i++) shm_config->hdr->alphptr[i] = 0L; @@ -184,8 +186,10 @@ void symtab_init (void) fprintf (stderr, "symtab_init: could not attach to symbol table semaphore\r\n"); exit (1); } - - mbpartition = shm_config->hdr->partition; + + if (shm_config->hdr->use_mb_globals == TRUE) { + mbpartition = shm_config->hdr->partition; + } symtab_release_sem (); }