/[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.17 by sysadm, Sat Oct 18 12:06:10 2025 UTC Revision 1.21 by sysadm, Tue Nov 11 00:28:05 2025 UTC
# Line 1  Line 1 
1  /***************************************************************************  /* SPDX-License-Identifier: GPL-3.0-or-later */
2                                                  file_loader.c  -  description  /*
3                                                           -------------------   * file_loader
4          Copyright            : (C) 2004-2025 by Leaflet   *   - shared memory based file loader
5          Email                : leaflet@leafok.com   *
6   ***************************************************************************/   * Copyright (C) 2004-2025  Leaflet <leaflet@leafok.com>
7     */
8  /***************************************************************************  
9   *                                                                         *  #ifdef HAVE_CONFIG_H
10   *   This program is free software; you can redistribute it and/or modify  *  #include "config.h"
11   *   it under the terms of the GNU General Public License as published by  *  #endif
  *   the Free Software Foundation; either version 3 of the License, or     *  
  *   (at your option) any later version.                                   *  
  *                                                                         *  
  ***************************************************************************/  
12    
13  #include "file_loader.h"  #include "file_loader.h"
14  #include "log.h"  #include "log.h"
# Line 60  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 180  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