Changeset 2109:0b8deb4a879d in roaraudio
- Timestamp:
- 07/22/09 15:14:12 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/roard.c
r2106 r2109 42 42 " --daemon - Bring the server into background after init\n" 43 43 " --terminate - Terminate after last client quited\n" 44 " --start - No op parameter (starting roard is default operation)\n" 44 45 " --restart - Trys to stop an old instance and start a new with new settings\n" 46 " --stop - Stops a running roard (provide --pidfile!)\n" 47 " --shutdown - Terminates a running roard (provide --pidfile!)\n" 45 48 " --realtime - Trys to get realtime priority,\n" 46 49 " give multible times for being more realtime\n" … … 135 138 #endif 136 139 137 int restart_server (char * server ) {140 int restart_server (char * server, int terminate) { 138 141 struct roar_connection con; 142 139 143 if ( roar_connect(&con, server) == -1 ) { 140 144 return -1; 141 145 } 142 146 143 if ( roar_terminate(&con, 1) == -1 ) {147 if ( roar_terminate(&con, terminate) == -1 ) { 144 148 return -1; 145 149 } … … 622 626 return 0; 623 627 628 } else if ( strcmp(k, "--start") == 0 ) { 629 // this is a no op 624 630 } else if ( strcmp(k, "--restart") == 0 ) { 625 631 #ifdef ROAR_SUPPORT_LISTEN 626 if ( restart_server(server ) == -1 ) {632 if ( restart_server(server, 1) == -1 ) { 627 633 ROAR_WARN("Can not terminate old server (not running at %s?), tring to continue anyway", server); 628 634 } … … 630 636 ROAR_ERR("--restart not supported"); 631 637 #endif 638 } else if ( strcmp(k, "--shutdown") == 0 ) { 639 #ifdef ROAR_SUPPORT_LISTEN 640 if ( restart_server(server, 1) == -1 ) { 641 ROAR_WARN("Can not terminate old server (not running at %s?)", server); 642 return 1; 643 } 644 return 0; 645 #else 646 ROAR_ERR("--shutdown not supported"); 647 return 1; 648 #endif 649 } else if ( strcmp(k, "--stop") == 0 ) { 650 #ifdef ROAR_SUPPORT_LISTEN 651 if ( restart_server(server, 1) == -1 ) { 652 ROAR_WARN("Can not stop old server (not running at %s?)", server); 653 return 1; 654 } 655 return 0; 656 #else 657 ROAR_ERR("--stop not supported"); 658 return 1; 659 #endif 660 632 661 633 662 } else if ( strcmp(k, "--demon") == 0 || strcmp(k, "--daemon") == 0 ) {
Note: See TracChangeset
for help on using the changeset viewer.