Changeset 5268
- Timestamp:
- 02/14/08 06:16:33 (10 months ago)
- Files:
-
- trackerd/trunk/trackerd/main.c (modified) (5 diffs)
- trackerd/trunk/trackerd/settings.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trackerd/trunk/trackerd/main.c
r5146 r5268 59 59 60 60 61 static wi_boolean_t wt_daemonize = true;62 63 61 wi_boolean_t wt_running = true; 64 62 … … 96 94 97 95 /* set defaults */ 98 wi_ root_path = wi_string_init_with_cstring(wi_string_alloc(), WT_ROOT);96 wi_set_root_path(WI_STR(WT_ROOT)); 99 97 wi_settings_config_path = wi_string_init_with_cstring(wi_string_alloc(), WT_CONFIG_PATH); 100 98 no_chroot = false; … … 117 115 118 116 case 'D': 119 wt_daemonize = false;117 daemonize = false; 120 118 wi_log_stderr = true; 121 119 break; 122 120 123 121 case 'd': 124 wi_release(wi_root_path); 125 wi_root_path = wi_string_init_with_cstring(wi_string_alloc(), optarg); 122 wi_set_root_path(wi_string_with_cstring(optarg)); 126 123 break; 127 124 … … 191 188 /* detach */ 192 189 if(daemonize) { 190 wi_log_info(WI_STR("forking")); 193 191 wi_array_add_data(arguments, WI_STR("-X")); 194 192 wi_array_insert_data_at_index(arguments, wi_string_with_cstring(argv[0]), 0); … … 222 220 wt_servers_init(); 223 221 222 /* change root directory */ 223 if(!no_chroot) { 224 if(!wi_chroot_to_root_path()) 225 wi_log_err(WI_STR("Could not change root directory: %m")); 226 } 227 224 228 /* read the config file */ 225 wt_settings_chroot = !no_chroot;226 229 wt_settings_init(); 227 230 228 231 if(!wt_settings_read_config()) 229 232 exit(1); 230 231 /* change root directory */232 if(!no_chroot) {233 if(!wi_change_root())234 wi_log_err(WI_STR("Could not change root to %@: %m"), wi_root_path);235 }236 233 237 234 /* apply settings */ trackerd/trunk/trackerd/settings.c
r5078 r5268 37 37 38 38 wt_settings_t wt_settings; 39 wi_boolean_t wt_settings_chroot;40 39 41 40 static wi_settings_t *wt_wi_settings; … … 75 74 76 75 wi_boolean_t wt_settings_read_config(void) { 77 return wi_settings_read_file(wt_wi_settings , wt_settings_chroot);76 return wi_settings_read_file(wt_wi_settings); 78 77 } 79 78
