Changeset 18 in Main for trunk/Server/main.c
- Timestamp:
- Sep 14, 2024, 9:42:40 AM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/main.c
r16 r18 17 17 18 18 extern bool cm_do_log; 19 extern struct tw_config config; 20 21 char tw_server[2048]; 19 22 20 23 int main(int argc, char** argv) { 21 24 int i; 22 const char* conf ig= PREFIX "/etc/tewi.conf";25 const char* confpath = PREFIX "/etc/tewi.conf"; 23 26 for(i = 1; i < argc; i++) { 24 27 if(argv[i][0] == '-') { … … 36 39 return 1; 37 40 } 38 conf ig= argv[i];41 confpath = argv[i]; 39 42 } else { 40 43 fprintf(stderr, "Unknown option: %s\n", argv[i]); … … 44 47 } 45 48 tw_config_init(); 46 if(tw_config_read(conf ig) != 0) {49 if(tw_config_read(confpath) != 0) { 47 50 fprintf(stderr, "Could not read the config\n"); 48 51 return 1; … … 52 55 return 1; 53 56 } 57 sprintf(tw_server, "Tewi/%s (%s)%s", tw_get_version(), tw_get_platform(), config.extension == NULL ? "" : config.extension); 54 58 cm_log("Daemon", "Ready"); 55 59 #ifndef __MINGW32__
Note:
See TracChangeset
for help on using the changeset viewer.