Changeset 134 for branches/samba-3.0/source/nmbd
- Timestamp:
- May 23, 2008, 6:56:41 AM (17 years ago)
- Location:
- branches/samba-3.0/source/nmbd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/nmbd/nmbd.c
r124 r134 158 158 static time_t lastt; 159 159 int n; 160 bool print_waiting_msg = true; 160 161 struct subnet_record *subrec; 161 162 … … 168 169 return; 169 170 } 171 172 try_again: 170 173 171 174 /* the list of probed interfaces has changed, we may need to add/remove 172 175 some subnets */ 173 176 load_interfaces(); 174 175 try_again:176 177 177 178 /* find any interfaces that need adding */ … … 234 235 /* We need to wait if there are no subnets... */ 235 236 if (FIRST_SUBNET == NULL) { 236 void (*saved_handler)(int); 237 238 DEBUG(0,("reload_interfaces: " 239 "No subnets to listen to. Waiting..\n")); 237 238 if (print_waiting_msg) { 239 DEBUG(0,("reload_interfaces: " 240 "No subnets to listen to. Waiting..\n")); 241 print_waiting_msg = false; 242 } 240 243 241 244 /* … … 244 247 */ 245 248 246 saved_handler = CatchSignal( SIGTERM, SIGNAL_CAST SIG_DFL);247 248 while (iface_count() == 0 ) {249 BlockSignals(false, SIGTERM); 250 251 while (iface_count() == 0 && !got_sig_term) { 249 252 sleep(5); 250 253 load_interfaces(); … … 252 255 253 256 /* 254 * We got an interface, restore our normal term handler. 255 */ 256 257 CatchSignal( SIGTERM, SIGNAL_CAST saved_handler ); 257 * Handle termination inband. 258 */ 259 260 if (got_sig_term) { 261 got_sig_term = 0; 262 terminate(); 263 } 264 265 /* 266 * We got an interface, go back to blocking term. 267 */ 268 269 BlockSignals(true, SIGTERM); 258 270 goto try_again; 259 271 } -
branches/samba-3.0/source/nmbd/nmbd_subnetdb.c
r44 r134 181 181 BOOL create_subnets(void) 182 182 { 183 int num_interfaces = iface_count();183 int num_interfaces; 184 184 int i; 185 185 struct in_addr unicast_ip, ipzero; 186 186 187 if(num_interfaces == 0) { 188 void (*saved_handler)(int); 189 187 try_interfaces_again: 188 189 if (iface_count() == 0) { 190 190 DEBUG(0,("create_subnets: No local interfaces !\n")); 191 191 DEBUG(0,("create_subnets: Waiting for an interface to appear ...\n")); 192 } 193 194 while (iface_count() == 0) { 195 void (*saved_handler)(int); 192 196 193 197 /* … … 198 202 saved_handler = CatchSignal( SIGTERM, SIGNAL_CAST SIG_DFL ); 199 203 200 while (iface_count() == 0) { 201 sleep(5); 202 load_interfaces(); 203 } 204 sleep(5); 205 load_interfaces(); 204 206 205 207 /* … … 242 244 /* We must have at least one subnet. */ 243 245 if (subnetlist == NULL) { 244 DEBUG(0,("create_subnets: unable to create any subnet from " 245 "given interfaces. nmbd is terminating\n")); 246 return False; 246 void (*saved_handler)(int); 247 248 DEBUG(0,("create_subnets: Unable to create any subnet from " 249 "given interfaces. Is your interface line in " 250 "smb.conf correct ?\n")); 251 252 saved_handler = CatchSignal( SIGTERM, SIGNAL_CAST SIG_DFL ); 253 254 sleep(5); 255 load_interfaces(); 256 257 CatchSignal( SIGTERM, SIGNAL_CAST saved_handler ); 258 goto try_interfaces_again; 247 259 } 248 260
Note:
See TracChangeset
for help on using the changeset viewer.