Changeset 12070
- Timestamp:
- 05/09/09 12:50:13 (4 years ago)
- Location:
- src/router
- Files:
-
- 4 edited
-
rc/rc.h (modified) (2 diffs)
-
rc/servicemanager.c (modified) (11 diffs)
-
rc/services.c (modified) (26 diffs)
-
shared/shutils.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/rc/rc.h
r10738 r12070 156 156 157 157 extern void start_service( char *name ); 158 extern void startstop( char *name ); 158 159 extern void stop_service( char *name ); 159 160 extern void *start_service_nofree( char *name, void *handle ); … … 163 164 extern int start_main( char *name, int argc, char **argv ); 164 165 extern void start_servicei( char *name, int param ); 166 167 168 169 extern void startstop_f( char *name ); 170 extern void start_service_f( char *name ); 171 extern void stop_service_f( char *name ); 172 extern void *start_service_nofree_f( char *name, void *handle ); 173 extern void *stop_service_nofree_f( char *name, void *handle ); 174 extern int startstop_main_f( int argc, char **argv ); 175 extern void *startstop_nofree_f( char *name, void *handle ); 176 extern int start_main_f( char *name, int argc, char **argv ); 177 extern void start_servicei_f( char *name, int param ); 165 178 166 179 extern int zebra_ospf_init( void ); -
src/router/rc/servicemanager.c
r10737 r12070 23 23 #include <dlfcn.h> 24 24 #include <stdio.h> 25 //#include <shutils.h>25 #include <shutils.h> 26 26 27 27 #define SERVICE_MODULE "/lib/services.so" 28 #define cprintf(fmt, args...) 29 30 #ifndef cprintf 31 #define cprintf(fmt, args...) do { \ 32 FILE *fp = fopen("/dev/console", "w"); \ 33 if (fp) { \ 34 fprintf(fp,"%s (%d):%s ",__FILE__,__LINE__,__func__); \ 35 fprintf(fp, fmt, ## args); \ 36 fclose(fp); \ 37 } \ 38 } while (0) 39 #endif 28 40 29 41 30 void *load_service( char *name ) … … 97 86 return 0; 98 87 } 88 int start_service_f( char *name ) 89 { 90 FORK(start_service(name)); 91 } 99 92 100 93 int start_service_fork( char *name ) … … 132 125 return 0; 133 126 } 134 127 int start_service_fork_f( char *name ) 128 { 129 FORK(start_service_fork(name)); 130 } 135 131 void *start_service_nofree( char *name, void *handle ) 136 132 { … … 167 163 return handle; 168 164 } 169 165 void *start_service_nofree_f( char *name, void *handle ) 166 { 167 FORK(start_service_nofree(name,handle)); 168 } 170 169 int start_servicep( char *name, char *param ) 171 170 { … … 191 190 return 0; 192 191 } 193 192 int start_servicep_f( char *name, char *param ) 193 { 194 FORK(start_servicep(name,param)); 195 } 194 196 void start_servicei( char *name, int param ) 195 197 { … … 216 218 return; 217 219 } 218 220 void start_servicei_f( char *name, int param ) 221 { 222 FORK(start_servicei(name,param)); 223 } 219 224 void start_main( char *name, int argc, char **argv ) 220 225 { … … 240 245 return; 241 246 } 242 247 void start_main_f( char *name, int argc, char **argv ) 248 { 249 FORK(start_main(name,argc,argv)); 250 } 243 251 void stop_service( char *name ) 244 252 { … … 265 273 266 274 return; 275 } 276 void stop_service_f( char *name ) 277 { 278 FORK(stop_service(name)); 267 279 } 268 280 … … 291 303 return handle; 292 304 } 293 305 void *stop_service_nofree_f( char *name, void *handle ) 306 { 307 FORK(stop_service_nofree(name,handle)); 308 } 294 309 void startstop( char *name ) 295 310 { … … 303 318 } 304 319 320 void startstop_f( char *name ) 321 { 322 FORK(startstop(name)); 323 } 324 305 325 int startstop_main( int argc, char **argv ) 306 326 { 307 327 startstop( argv[1] ); 308 328 return 0; 329 } 330 331 int startstop_main_f( int argc, char **argv ) 332 { 333 FORK(startstop_main(argc,argv)); 309 334 } 310 335 … … 316 341 return handle; 317 342 } 343 344 void *startstop_nofree_f( char *name, void *handle ) 345 { 346 FORK(startstop_nofree_f(name,handle)); 347 } -
src/router/rc/services.c
r12059 r12070 87 87 nvram_set( "qos_done", "0" ); 88 88 #ifdef HAVE_CPUTEMP 89 handle = start_service_nofree ( "hwmon", handle );89 handle = start_service_nofree_f( "hwmon", handle ); 90 90 #endif 91 91 #ifdef HAVE_TELNET 92 handle = start_service_nofree ( "telnetd", handle );92 handle = start_service_nofree_f( "telnetd", handle ); 93 93 #endif 94 94 #ifdef HAVE_FTP 95 handle = start_service_nofree ( "ftpsrv", handle );95 handle = start_service_nofree_f( "ftpsrv", handle ); 96 96 #endif 97 97 #ifdef HAVE_SAMBA_SRV 98 handle = start_service_nofree ( "sambasrv", handle );98 handle = start_service_nofree_f( "sambasrv", handle ); 99 99 #endif 100 100 #ifdef HAVE_SYSLOG 101 handle = start_service_nofree ( "syslog", handle );101 handle = start_service_nofree_f( "syslog", handle ); 102 102 #endif 103 103 #ifdef HAVE_TFTP 104 handle = start_service_nofree ( "tftpd", handle );105 #endif 106 handle = start_service_nofree ( "httpd", handle );107 handle = start_service_nofree ( "udhcpd", handle );104 handle = start_service_nofree_f( "tftpd", handle ); 105 #endif 106 handle = start_service_nofree_f( "httpd", handle ); 107 handle = start_service_nofree_f( "udhcpd", handle ); 108 108 #ifdef HAVE_DNSMASQ 109 handle = start_service_nofree ( "dnsmasq", handle );109 handle = start_service_nofree_f( "dnsmasq", handle ); 110 110 #endif 111 111 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 112 handle = start_service_nofree ( "zebra", handle );112 handle = start_service_nofree_f( "zebra", handle ); 113 113 #endif 114 114 #ifdef HAVE_OLSRD 115 handle = start_service_nofree ( "olsrd", handle );116 #endif 117 118 handle = start_service_nofree ( "wshaper", handle );119 handle = start_service_nofree ( "wland", handle );120 handle = start_service_nofree ( "cron", handle );115 handle = start_service_nofree_f( "olsrd", handle ); 116 #endif 117 118 handle = start_service_nofree_f( "wshaper", handle ); 119 handle = start_service_nofree_f( "wland", handle ); 120 handle = start_service_nofree_f( "cron", handle ); 121 121 122 122 #ifdef HAVE_PPTPD 123 handle = start_service_nofree ( "pptpd", handle );123 handle = start_service_nofree_f( "pptpd", handle ); 124 124 #endif 125 125 … … 128 128 if( isregistered_real( ) ) 129 129 #endif 130 handle = start_service_nofree ( "sshd", handle );130 handle = start_service_nofree_f( "sshd", handle ); 131 131 #endif 132 132 133 133 #ifdef HAVE_RADVD 134 handle = start_service_nofree ( "radvd", handle );134 handle = start_service_nofree_f( "radvd", handle ); 135 135 #endif 136 136 137 137 #ifdef HAVE_SNMP 138 handle = start_service_nofree ( "snmp", handle );138 handle = start_service_nofree_f( "snmp", handle ); 139 139 #endif 140 140 141 141 #ifdef HAVE_PPPOESERVER 142 handle = start_service_nofree ( "pppoeserver", handle );142 handle = start_service_nofree_f( "pppoeserver", handle ); 143 143 #endif 144 144 145 145 #ifdef HAVE_WOL 146 handle = start_service_nofree ( "wol", handle );146 handle = start_service_nofree_f( "wol", handle ); 147 147 #endif 148 148 149 149 #ifdef HAVE_NOCAT 150 handle = start_service_nofree ( "splashd", handle );150 handle = start_service_nofree_f( "splashd", handle ); 151 151 #endif 152 152 153 153 #ifdef HAVE_UPNP 154 handle = start_service_nofree ( "upnp", handle );154 handle = start_service_nofree_f( "upnp", handle ); 155 155 #endif 156 156 157 157 #ifdef HAVE_OPENVPN 158 handle = start_service_nofree ( "openvpnserversys", handle );158 handle = start_service_nofree_f( "openvpnserversys", handle ); 159 159 #endif 160 160 #ifdef HAVE_VNCREPEATER 161 handle = start_service_nofree ( "vncrepeater", handle );161 handle = start_service_nofree_f( "vncrepeater", handle ); 162 162 #endif 163 163 #ifdef HAVE_RSTATS 164 handle = start_service_nofree ( "rstats", handle );164 handle = start_service_nofree_f( "rstats", handle ); 165 165 #endif 166 166 #ifdef HAVE_NSTX 167 handle = start_service_nofree ( "nstxd", handle );167 handle = start_service_nofree_f( "nstxd", handle ); 168 168 #endif 169 169 #ifdef HAVE_PPPOERELAY 170 handle = start_service_nofree ( "pppoerelay", handle );170 handle = start_service_nofree_f( "pppoerelay", handle ); 171 171 #endif 172 172 #ifdef HAVE_MILKFISH 173 handle = start_service_nofree ( "milkfish", handle );173 handle = start_service_nofree_f( "milkfish", handle ); 174 174 #endif 175 175 if( handle ) … … 281 281 static void handle_dhcpd( void ) 282 282 { 283 startstop ( "udhcpd" );283 startstop_f( "udhcpd" ); 284 284 } 285 285 … … 321 321 #endif 322 322 handle = start_service_nofree( "wan_boot", handle ); 323 handle = start_service_nofree ( "ttraff", handle );323 handle = start_service_nofree_f( "ttraff", handle ); 324 324 #ifdef HAVE_MADWIFI 325 handle = start_service_nofree ( "stabridge", handle );326 #endif 327 handle = startstop_nofree ( "udhcpd", handle );325 handle = start_service_nofree_f( "stabridge", handle ); 326 #endif 327 handle = startstop_nofree_f( "udhcpd", handle ); 328 328 #ifdef HAVE_DNSMASQ 329 handle = startstop_nofree ( "dnsmasq", handle );329 handle = startstop_nofree_f( "dnsmasq", handle ); 330 330 #endif 331 331 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 332 handle = startstop_nofree ( "zebra", handle );332 handle = startstop_nofree_f( "zebra", handle ); 333 333 #endif 334 334 #ifdef HAVE_OLSRD 335 handle = startstop_nofree ( "olsrd", handle );335 handle = startstop_nofree_f( "olsrd", handle ); 336 336 #endif 337 337 #ifdef HAVE_VLANTAGGING … … 345 345 #endif 346 346 #endif 347 handle = start_service_nofree ( "radio_timer", handle );348 handle = startstop_nofree ( "firewall", handle );349 handle = startstop_nofree ( "httpd", handle ); // httpd will not347 handle = start_service_nofree_f( "radio_timer", handle ); 348 handle = startstop_nofree_f( "firewall", handle ); 349 handle = startstop_nofree_f( "httpd", handle ); // httpd will not 350 350 // accept connection 351 351 // anymore on wan/lan 352 352 // ip changes changes 353 handle = startstop_nofree ( "cron", handle ); // httpd will not353 handle = startstop_nofree_f( "cron", handle ); // httpd will not 354 354 // accept connection 355 355 // anymore on wan/lan 356 356 // ip changes changes 357 handle = start_service_nofree ( "anchorfreednat", handle );357 handle = start_service_nofree_f( "anchorfreednat", handle ); 358 358 handle = start_service_nofree( "wan_boot", handle ); 359 359 if( handle ) … … 366 366 367 367 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 368 handle = startstop_nofree ( "zebra", handle );368 handle = startstop_nofree_f( "zebra", handle ); 369 369 #endif 370 370 #ifdef HAVE_OLSRD 371 handle = startstop_nofree ( "olsrd", handle );371 handle = startstop_nofree_f( "olsrd", handle ); 372 372 #endif 373 373 if( handle ) … … 378 378 void *handle = NULL; 379 379 380 handle = startstop_nofree ( "anchorfree", handle );381 handle = start_service_nofree ( "anchorfreednat", handle );380 handle = startstop_nofree_f( "anchorfree", handle ); 381 handle = start_service_nofree_f( "anchorfreednat", handle ); 382 382 if( handle ) 383 383 dlclose( handle ); … … 389 389 390 390 #ifdef HAVE_WIFIDOG 391 handle = startstop_nofree ( "wifidog", handle );391 handle = startstop_nofree_f( "wifidog", handle ); 392 392 #endif 393 393 #ifdef HAVE_NOCAT 394 handle = startstop_nofree ( "splashd", handle );394 handle = startstop_nofree_f( "splashd", handle ); 395 395 #endif 396 396 #ifdef HAVE_CHILLI 397 handle = startstop_nofree ( "chilli", handle );397 handle = startstop_nofree_f( "chilli", handle ); 398 398 #endif 399 399 #ifdef HAVE_SPUTNIK_APD 400 handle = startstop_nofree ( "sputnik", handle );400 handle = startstop_nofree_f( "sputnik", handle ); 401 401 #endif 402 402 if( handle ) … … 414 414 415 415 #ifdef HAVE_PPPOERELAY 416 handle = startstop_nofree ( "pppoerelay", handle );417 #endif 418 handle = startstop_nofree ( "udhcpd", handle );416 handle = startstop_nofree_f( "pppoerelay", handle ); 417 #endif 418 handle = startstop_nofree_f( "udhcpd", handle ); 419 419 #ifdef HAVE_SYSLOG 420 handle = startstop_nofree ( "syslog", handle );420 handle = startstop_nofree_f( "syslog", handle ); 421 421 #endif 422 422 #ifdef HAVE_RSTATS 423 handle = startstop_nofree ( "rstats", handle );424 #endif 425 handle = startstop_nofree ( "ttraff", handle );423 handle = startstop_nofree_f( "rstats", handle ); 424 #endif 425 handle = startstop_nofree_f( "ttraff", handle ); 426 426 #ifdef HAVE_NSTX 427 handle = startstop_nofree ( "nstxd", handle );427 handle = startstop_nofree_f( "nstxd", handle ); 428 428 #endif 429 429 #ifdef HAVE_PPPOESERVER 430 handle = startstop_nofree ( "firewall", handle );431 handle = startstop_nofree ( "pppoeserver", handle );430 handle = startstop_nofree_f( "firewall", handle ); 431 handle = startstop_nofree_f( "pppoeserver", handle ); 432 432 #endif 433 433 #ifdef HAVE_DNSMASQ 434 handle = startstop_nofree ( "dnsmasq", handle );435 #endif 436 handle = startstop_nofree ( "udhcpd", handle );434 handle = startstop_nofree_f( "dnsmasq", handle ); 435 #endif 436 handle = startstop_nofree_f( "udhcpd", handle ); 437 437 #ifdef HAVE_CPUTEMP 438 handle = start_service_nofree ( "hwmon", handle );438 handle = start_service_nofree_f( "hwmon", handle ); 439 439 #endif 440 440 #ifdef HAVE_TELNET 441 handle = startstop_nofree ( "telnetd", handle );441 handle = startstop_nofree_f( "telnetd", handle ); 442 442 #endif 443 443 #ifdef HAVE_SNMP 444 handle = startstop_nofree ( "snmp", handle );444 handle = startstop_nofree_f( "snmp", handle ); 445 445 #endif 446 446 #ifdef HAVE_OPENVPN 447 handle = startstop_nofree ( "openvpn", handle );447 handle = startstop_nofree_f( "openvpn", handle ); 448 448 #endif 449 449 #ifdef HAVE_PPTPD 450 handle = startstop_nofree ( "pptpd", handle );450 handle = startstop_nofree_f( "pptpd", handle ); 451 451 #endif 452 452 #ifdef HAVE_PPTP … … 463 463 if( isregistered_real( ) ) 464 464 #endif 465 handle = startstop_nofree ( "sshd", handle );466 #endif 467 handle = startstop_nofree ( "firewall", handle );468 handle = startstop_nofree ( "wshaper", handle );465 handle = startstop_nofree_f( "sshd", handle ); 466 #endif 467 handle = startstop_nofree_f( "firewall", handle ); 468 handle = startstop_nofree_f( "wshaper", handle ); 469 469 #ifdef HAVE_SYSLOG 470 handle = startstop_nofree ( "syslog", handle );470 handle = startstop_nofree_f( "syslog", handle ); 471 471 #endif 472 472 #ifdef HAVE_VNCREPEATER 473 handle = startstop_nofree ( "vncrepeater", handle );473 handle = startstop_nofree_f( "vncrepeater", handle ); 474 474 #endif 475 475 #ifdef HAVE_OPENVPN 476 handle = startstop_nofree ( "openvpnserver", handle );477 #endif 478 handle = start_service_nofree ( "anchorfreednat", handle );476 handle = startstop_nofree_f( "openvpnserver", handle ); 477 #endif 478 handle = start_service_nofree_f( "anchorfreednat", handle ); 479 479 if( handle ) 480 480 dlclose( handle ); … … 487 487 488 488 #ifdef HAVE_FTP 489 handle = startstop_nofree ( "ftpsrv", handle );489 handle = startstop_nofree_f( "ftpsrv", handle ); 490 490 #endif 491 491 #ifdef HAVE_SAMBA_SRV 492 handle = startstop_nofree ( "sambasrv", handle );492 handle = startstop_nofree_f( "sambasrv", handle ); 493 493 #endif 494 494 if( handle ) … … 509 509 handle = stop_service_nofree( "cron", handle ); 510 510 handle = stop_service_nofree( "udhcpd", handle ); 511 handle = start_service_nofree ( "udhcpd", handle );512 handle = start_service_nofree ( "cron", handle );511 handle = start_service_nofree_f( "udhcpd", handle ); 512 handle = start_service_nofree_f( "cron", handle ); 513 513 #ifdef HAVE_IPV6 514 handle = start_service_nofree ( "ipv6", handle );514 handle = start_service_nofree_f( "ipv6", handle ); 515 515 #endif 516 516 #ifdef HAVE_RADVD 517 handle = startstop_nofree ( "radvd", handle );517 handle = startstop_nofree_f( "radvd", handle ); 518 518 #endif 519 519 #ifdef HAVE_PPTPD 520 handle = startstop_nofree ( "pptpd", handle );520 handle = startstop_nofree_f( "pptpd", handle ); 521 521 #endif 522 522 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 523 handle = start_service_nofree ( "zebra", handle );524 #endif 525 handle = startstop_nofree ( "firewall", handle );523 handle = start_service_nofree_f( "zebra", handle ); 524 #endif 525 handle = startstop_nofree_f( "firewall", handle ); 526 526 handle = stop_service_nofree( "wland", handle ); 527 handle = startstop_nofree ( "wshaper", handle );528 handle = start_service_nofree ( "wland", handle );529 handle = startstop_nofree ( "httpd", handle );527 handle = startstop_nofree_f( "wshaper", handle ); 528 handle = start_service_nofree_f( "wland", handle ); 529 handle = startstop_nofree_f( "httpd", handle ); 530 530 531 531 #ifdef HAVE_WOL 532 handle = startstop_nofree ( "wol", handle );532 handle = startstop_nofree_f( "wol", handle ); 533 533 #endif 534 534 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) … … 538 538 #endif 539 539 #endif 540 handle = start_service_nofree ( "anchorfreednat", handle );540 handle = start_service_nofree_f( "anchorfreednat", handle ); 541 541 542 542 if( handle ) … … 578 578 #endif 579 579 handle = start_service_nofree( "wan_boot", handle ); 580 handle = start_service_nofree ( "ttraff", handle );580 handle = start_service_nofree_f( "ttraff", handle ); 581 581 #ifdef HAVE_MADWIFI 582 handle = start_service_nofree ( "stabridge", handle );582 handle = start_service_nofree_f( "stabridge", handle ); 583 583 #endif 584 584 #ifdef HAVE_VLANTAGGING … … 592 592 #endif 593 593 #endif 594 handle = start_service_nofree ( "radio_timer", handle );594 handle = start_service_nofree_f( "radio_timer", handle ); 595 595 if( handle ) 596 596 dlclose( handle ); … … 599 599 static void handle_spppoe( void ) 600 600 { 601 stop_service ( "ttraff" );602 stop_service ( "wan" );601 stop_service_f( "ttraff" ); 602 stop_service_f( "wan" ); 603 603 } 604 604 static void handle_filters( void ) … … 607 607 608 608 handle = stop_service_nofree( "cron", handle ); 609 handle = startstop_nofree ( "firewall", handle );609 handle = startstop_nofree_f( "firewall", handle ); 610 610 #ifdef HAVE_SYSLOG 611 handle = startstop_nofree ( "syslog", handle );611 handle = startstop_nofree_f( "syslog", handle ); 612 612 #endif 613 613 handle = stop_service_nofree( "wland", handle ); 614 handle = startstop_nofree ( "wshaper", handle );615 handle = start_service_nofree ( "wland", handle );616 handle = start_service_nofree ( "cron", handle );614 handle = startstop_nofree_f( "wshaper", handle ); 615 handle = start_service_nofree_f( "wland", handle ); 616 handle = start_service_nofree_f( "cron", handle ); 617 617 #ifdef HAVE_MULTICAST 618 handle = startstop_nofree ( "igmp_proxy", handle );619 #endif 620 handle = start_service_nofree ( "anchorfreednat", handle );618 handle = startstop_nofree_f( "igmp_proxy", handle ); 619 #endif 620 handle = start_service_nofree_f( "anchorfreednat", handle ); 621 621 if( handle ) 622 622 dlclose( handle ); … … 629 629 handle = stop_service_nofree( "zebra", handle ); 630 630 #endif 631 handle = startstop_nofree ( "firewall", handle );632 handle = start_service_nofree ( "set_routes", handle );631 handle = startstop_nofree_f( "firewall", handle ); 632 handle = start_service_nofree_f( "set_routes", handle ); 633 633 #if defined(HAVE_BIRD) || defined(HAVE_QUAGGA) 634 handle = start_service_nofree ( "zebra", handle );634 handle = start_service_nofree_f( "zebra", handle ); 635 635 #endif 636 636 #ifdef HAVE_OLSRD 637 handle = startstop_nofree ( "olsrd", handle );638 #endif 639 handle = start_service_nofree ( "anchorfreednat", handle );637 handle = startstop_nofree_f( "olsrd", handle ); 638 #endif 639 handle = start_service_nofree_f( "anchorfreednat", handle ); 640 640 if( handle ) 641 641 dlclose( handle ); … … 656 656 eval( "/etc/config/proxywatchdog.startup" ); 657 657 } 658 handle = start_service_nofree ( "cron", handle );658 handle = start_service_nofree_f( "cron", handle ); 659 659 if( handle ) 660 660 dlclose( handle ); … … 671 671 #endif 672 672 handle = stop_service_nofree( "firewall", handle ); 673 handle = start_service_nofree ( "firewall", handle );673 handle = start_service_nofree_f( "firewall", handle ); 674 674 #ifdef HAVE_UPNP 675 675 // handle = start_service_nofree( "upnp", handle ); 676 676 #endif 677 handle = start_service_nofree ( "wshaper", handle );678 handle = start_service_nofree ( "wland", handle );679 handle = start_service_nofree ( "anchorfreednat", handle );677 handle = start_service_nofree_f( "wshaper", handle ); 678 handle = start_service_nofree_f( "wland", handle ); 679 handle = start_service_nofree_f( "anchorfreednat", handle ); 680 680 if( handle ) 681 681 dlclose( handle ); … … 684 684 static void handle_qos( void ) 685 685 { 686 startstop ( "wshaper" );687 startstop ( "wland" );686 startstop_f( "wshaper" ); 687 startstop_f( "wland" ); 688 688 } 689 689 … … 696 696 #endif 697 697 handle = stop_service_nofree( "firewall", handle ); 698 handle = start_service_nofree ( "firewall", handle );698 handle = start_service_nofree_f( "firewall", handle ); 699 699 #ifdef HAVE_UPNP 700 handle = start_service_nofree ( "upnp", handle );700 handle = start_service_nofree_f( "upnp", handle ); 701 701 #endif 702 702 handle = stop_service_nofree( "wland", handle ); 703 handle = startstop_nofree ( "wshaper", handle );704 handle = start_service_nofree ( "wland", handle );705 handle = start_service_nofree ( "anchorfreednat", handle );703 handle = startstop_nofree_f( "wshaper", handle ); 704 handle = start_service_nofree_f( "wland", handle ); 705 handle = start_service_nofree_f( "anchorfreednat", handle ); 706 706 if( handle ) 707 707 dlclose( handle ); … … 818 818 #endif 819 819 handle = start_service_nofree( "wan", handle ); 820 handle = start_service_nofree ( "ttraff", handle );820 handle = start_service_nofree_f( "ttraff", handle ); 821 821 #ifdef HAVE_MADWIFI 822 handle = start_service_nofree ( "stabridge", handle );822 handle = start_service_nofree_f( "stabridge", handle ); 823 823 #endif 824 824 #ifdef HAVE_VLANTAGGING … … 832 832 #endif 833 833 #endif 834 handle = start_service_nofree ( "radio_timer", handle );834 handle = start_service_nofree_f( "radio_timer", handle ); 835 835 //restart dhcp as well, to fix repeater bridge save issue (dhcp disables itself here) 836 handle = startstop_nofree ( "udhcpd", handle );836 handle = startstop_nofree_f( "udhcpd", handle ); 837 837 #ifdef HAVE_DNSMASQ 838 handle = startstop_nofree ( "dnsmasq", handle );839 #endif 840 startstop ( "httpd" ); // httpd will not accept connection anymore838 handle = startstop_nofree_f( "dnsmasq", handle ); 839 #endif 840 startstop_f( "httpd" ); // httpd will not accept connection anymore 841 841 // on wan/lan ip changes changes 842 842 if( handle ) … … 900 900 { 901 901 handle = start_service_nofree( "wan", handle ); 902 handle = start_service_nofree ( "ttraff", handle );902 handle = start_service_nofree_f( "ttraff", handle ); 903 903 } 904 904 #ifdef HAVE_MADWIFI 905 handle = start_service_nofree ( "stabridge", handle );905 handle = start_service_nofree_f( "stabridge", handle ); 906 906 #endif 907 907 #ifdef HAVE_VLANTAGGING … … 915 915 #endif 916 916 #endif 917 handle = start_service_nofree ( "radio_timer", handle );917 handle = start_service_nofree_f( "radio_timer", handle ); 918 918 if( getSTA( ) || getWET( ) ) 919 startstop ( "httpd" ); // httpd will not accept connection anymore919 startstop_f( "httpd" ); // httpd will not accept connection anymore 920 920 // on wan/lan ip changes changes 921 921 #ifdef HAVE_MADWIFI 922 handle = start_service_nofree ( "hostapdwan", handle );922 handle = start_service_nofree_f( "hostapdwan", handle ); 923 923 #endif 924 924 if( handle ) -
src/router/shared/shutils.h
r10176 r12070 208 208 #endif 209 209 210 211 212 #ifndef HAVE_MICRO 213 #define FORK(a) a; 214 #else 215 #define FORK(func) \ 216 { \ 217 switch ( fork( ) ) \ 218 { \ 219 case -1: \ 220 return \ 221 break; \ 222 case 0: \ 223 ( void )setsid( ); \ 224 break; \ 225 default: \ 226 return \ 227 } \ 228 func; \ 229 return; \ 230 } 231 #endif 232 210 233 #ifdef vxworks 211 234 … … 218 241 #define ether_atoe(a, e) bcm_ether_atoe((a), (e)) 219 242 #define ether_etoa(e, a) bcm_ether_ntoa((e), (a)) 243 220 244 221 245 /*
Note: See TracChangeset
for help on using the changeset viewer.
