/[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.92 by sysadm, Tue Dec 23 13:08:13 2025 UTC Revision 1.94 by sysadm, Thu Jan 8 14:22:57 2026 UTC
# Line 3  Line 3 
3   * main   * main
4   *   - entry of server program   *   - entry of server program
5   *   *
6   * Copyright (C) 2004-2025  Leaflet <leaflet@leafok.com>   * Copyright (C) 2004-2026  Leaflet <leaflet@leafok.com>
7   */   */
8    
9  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
# Line 72  static void arg_foreground(void) Line 72  static void arg_foreground(void)
72          daemon_service = 0;          daemon_service = 0;
73  }  }
74    
75  static void arg_help(void)  static void arg_usage(void)
76  {  {
77          fprintf(stderr, "Usage: bbsd [-fhv] [...]\n\n");          fprintf(stderr, "Usage: bbsd [-fhvC] [...]\n\n");
78    
79          for (int i = 0; i < arg_options_count; i++)          for (int i = 0; i < arg_options_count; i++)
80          {          {
# Line 89  static void arg_help(void) Line 89  static void arg_help(void)
89          fprintf(stderr, "\n    If meet any bug, please report to <leaflet@leafok.com>\n\n");          fprintf(stderr, "\n    If meet any bug, please report to <leaflet@leafok.com>\n\n");
90  }  }
91    
92    static void arg_help(void)
93    {
94            arg_usage();
95    
96            exit(0);
97    }
98    
99  static void arg_version(void)  static void arg_version(void)
100  {  {
101          printf("%s\n", APP_INFO);          fprintf(stderr, "%s\n", APP_INFO);
102          printf("%s\n", COPYRIGHT_INFO);          fprintf(stderr, "%s\n", COPYRIGHT_INFO);
103    
104            exit(0);
105  }  }
106    
107  static void arg_display_log(void)  static void arg_display_log(void)
# Line 107  static void arg_display_error_log(void) Line 116  static void arg_display_error_log(void)
116    
117  static void arg_compile_info(void)  static void arg_compile_info(void)
118  {  {
119          printf("%s\n"          fprintf(stderr, "%s\n"
120                     "--enable-shared\t\t[%s]\n"                                          "--enable-shared\t\t[%s]\n"
121                     "--enable-systemd\t[%s]\n"                                          "--enable-systemd\t[%s]\n"
122                     "--with-debug\t\t[%s]\n"                                          "--with-debug\t\t[%s]\n"
123                     "--with-epoll\t\t[%s]\n"                                          "--with-epoll\t\t[%s]\n"
124                     "--with-mariadb\t\t[%s]\n"                                          "--with-mariadb\t\t[%s]\n"
125                     "--with-sysv\t\t[%s]\n",                                          "--with-sysv\t\t[%s]\n",
126                     APP_INFO,                          APP_INFO,
127  #ifdef _ENABLE_SHARED  #ifdef _ENABLE_SHARED
128                     "yes",                          "yes",
129  #else  #else
130                     "no",                          "no",
131  #endif  #endif
132  #ifdef HAVE_SYSTEMD_SD_DAEMON_H  #ifdef HAVE_SYSTEMD_SD_DAEMON_H
133                     "yes",                          "yes",
134  #else  #else
135                     "no",                          "no",
136  #endif  #endif
137  #ifdef _DEBUG  #ifdef _DEBUG
138                     "yes",                          "yes",
139  #else  #else
140                     "no",                          "no",
141  #endif  #endif
142  #ifdef HAVE_SYS_EPOLL_H  #ifdef HAVE_SYS_EPOLL_H
143                     "yes",                          "yes",
144  #else  #else
145                     "no",                          "no",
146  #endif  #endif
147  #ifdef HAVE_MARIADB_CLIENT  #ifdef HAVE_MARIADB_CLIENT
148                     "yes",                          "yes",
149  #else  #else
150                     "no",                          "no",
151  #endif  #endif
152  #ifdef HAVE_SYSTEM_V  #ifdef HAVE_SYSTEM_V
153                     "yes"                          "yes"
154  #else  #else
155                     "no"                          "no"
156  #endif  #endif
157          );          );
158    
159            exit(0);
160  }  }
161    
162  static void arg_error(void)  static void arg_error(void)
163  {  {
164          fprintf(stderr, "Invalid arguments\n");          fprintf(stderr, "Invalid arguments\n");
165          arg_help();          arg_usage();
166    
167            exit(1);
168  }  }
169    
170  int main(int argc, char *argv[])  int main(int argc, char *argv[])
# Line 216  int main(int argc, char *argv[]) Line 229  int main(int argc, char *argv[])
229                  return -1;                  return -1;
230          }          }
231    
232            fprintf(stderr, "%s\n", APP_INFO);
233    
234          // Initialize log          // Initialize log
235          if (log_begin(LOG_FILE_INFO, LOG_FILE_ERROR) < 0)          if (log_begin(LOG_FILE_INFO, LOG_FILE_ERROR) < 0)
236          {          {


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

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