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

Diff of /lbbs/src/file_loader.c

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

Revision 1.18 by sysadm, Tue Nov 4 13:49:51 2025 UTC Revision 1.21 by sysadm, Tue Nov 11 00:28:05 2025 UTC
# Line 3  Line 3 
3   * file_loader   * file_loader
4   *   - shared memory based file loader   *   - shared memory based file loader
5   *   *
6   * Copyright (C) 2004-2025 by Leaflet <leaflet@leafok.com>   * Copyright (C) 2004-2025  Leaflet <leaflet@leafok.com>
7   */   */
8    
9    #ifdef HAVE_CONFIG_H
10    #include "config.h"
11    #endif
12    
13  #include "file_loader.h"  #include "file_loader.h"
14  #include "log.h"  #include "log.h"
15  #include "str_process.h"  #include "str_process.h"
# Line 52  static void trie_file_dict_cleanup_cb(co Line 56  static void trie_file_dict_cleanup_cb(co
56  {  {
57          int shmid = (int)value;          int shmid = (int)value;
58    
59          if (shmctl(shmid, IPC_RMID, NULL) == -1)          if (shmid != 0 && shmctl(shmid, IPC_RMID, NULL) == -1)
60          {          {
61                  log_error("shmctl(shmid=%d, IPC_RMID) error (%d)\n", shmid, errno);                  log_error("shmctl(shmid=%d, IPC_RMID) error (%d)\n", shmid, errno);
62          }          }
# Line 172  int load_file(const char *filename) Line 176  int load_file(const char *filename)
176          {          {
177                  log_error("trie_dict_set(%s) error\n", filename);                  log_error("trie_dict_set(%s) error\n", filename);
178    
179                  if (shmctl(shmid, IPC_RMID, NULL) == -1)                  if (shmid != 0 && shmctl(shmid, IPC_RMID, NULL) == -1)
180                  {                  {
181                          log_error("shmctl(shmid=%d, IPC_RMID) error (%d)\n", shmid, errno);                          log_error("shmctl(shmid=%d, IPC_RMID) error (%d)\n", shmid, errno);
182                  }                  }


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

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