/[LeafOK_CVS]/lbbs/src/menu.c
ViewVC logotype

Diff of /lbbs/src/menu.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.44 by sysadm, Sat May 17 15:39:51 2025 UTC Revision 1.45 by sysadm, Sun May 18 03:23:57 2025 UTC
# Line 1071  int unload_menu(MENU_SET *p_menu_set) Line 1071  int unload_menu(MENU_SET *p_menu_set)
1071  int load_menu_shm(MENU_SET *p_menu_set)  int load_menu_shm(MENU_SET *p_menu_set)
1072  {  {
1073          // Mount shared memory          // Mount shared memory
1074          if (p_menu_set->p_reserved != NULL)          if (p_menu_set->p_reserved == NULL)
1075          {          {
1076                  log_error("Menu is already loaded\n");                  p_menu_set->p_reserved = shmat(p_menu_set->shmid, NULL, SHM_RDONLY);
1077                  return -1;                  if (p_menu_set->p_reserved == (void *)-1)
1078                    {
1079                            log_error("shmat() error (%d)\n", errno);
1080                            return -1;
1081                    }
1082          }          }
1083    
         p_menu_set->p_reserved = shmat(p_menu_set->shmid, NULL, SHM_RDONLY);  
         if (p_menu_set->p_reserved == (void *)-1)  
         {  
                 log_error("shmat() error (%d)\n", errno);  
                 return -2;  
         }  
1084          p_menu_set->p_menu_pool = p_menu_set->p_reserved + MENU_SET_RESERVED_LENGTH;          p_menu_set->p_menu_pool = p_menu_set->p_reserved + MENU_SET_RESERVED_LENGTH;
1085          p_menu_set->p_menu_item_pool = p_menu_set->p_menu_pool + sizeof(MENU) * MAX_MENUS;          p_menu_set->p_menu_item_pool = p_menu_set->p_menu_pool + sizeof(MENU) * MAX_MENUS;
1086          p_menu_set->p_menu_screen_pool = p_menu_set->p_menu_item_pool + sizeof(MENU_ITEM) * MAX_MENUITEMS;          p_menu_set->p_menu_screen_pool = p_menu_set->p_menu_item_pool + sizeof(MENU_ITEM) * MAX_MENUITEMS;


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1