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

Diff of /lbbs/src/main.c

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

Revision 1.43 by sysadm, Tue May 27 00:54:01 2025 UTC Revision 1.47 by sysadm, Thu May 29 00:52:09 2025 UTC
# Line 55  int main(int argc, char *argv[]) Line 55  int main(int argc, char *argv[])
55          int std_log_redir = 0;          int std_log_redir = 0;
56          int error_log_redir = 0;          int error_log_redir = 0;
57          FILE *fp;          FILE *fp;
58            int ret;
59            int last_aid;
60    
61          // Parse args          // Parse args
62          for (int i = 1; i < argc; i++)          for (int i = 1; i < argc; i++)
# Line 222  int main(int argc, char *argv[]) Line 224  int main(int argc, char *argv[])
224                  goto cleanup;                  goto cleanup;
225          }          }
226    
227          // Load section config          set_last_article_op_log_from_db();
228          if (append_articles_from_db(0, 1) < 0)          last_aid = 0;
229    
230            // Load section articles
231            do
232          {          {
233                  log_error("append_articles_from_db(0, 1) error\n");                  if ((ret = append_articles_from_db(last_aid + 1, 1, LOAD_ARTICLE_COUNT_LIMIT)) < 0)
234                  goto cleanup;                  {
235          }                          log_error("append_articles_from_db(0, 1, %d) error\n", LOAD_ARTICLE_COUNT_LIMIT);
236                            goto cleanup;
237                    }
238    
239          log_std("Debug: last_aid = %d\n", article_block_last_aid());                  last_aid = article_block_last_aid();
240            } while (ret == LOAD_ARTICLE_COUNT_LIMIT);
241    
242            log_std("Initially load %d articles, last_aid = %d\n", article_block_article_count(), article_block_last_aid());
243    
244          // Set signal handler          // Set signal handler
245          signal(SIGHUP, sig_hup_handler);          signal(SIGHUP, sig_hup_handler);
246          signal(SIGCHLD, sig_chld_handler);          signal(SIGCHLD, sig_chld_handler);
247          signal(SIGTERM, sig_term_handler);          signal(SIGTERM, sig_term_handler);
248    
249            // Launch section_list_loader process
250            if (section_list_loader_launch() < 0)
251            {
252                    log_error("section_list_loader_launch() error\n");
253                    goto cleanup;
254            }
255    
256          // Initialize socket server          // Initialize socket server
257          net_server(BBS_address, BBS_port);          net_server(BBS_address, BBS_port);
258    


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

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