[xiph-cvs] cvs commit: icecast/src main.c

Karl Heyes karl at xiph.org
Tue Feb 24 13:02:45 PST 2004



karl        04/02/24 16:02:45

  Modified:    src      main.c
  Log:
  small cleanup and don't shutdown curl too early

Revision  Changes    Path
1.39      +17 -28    icecast/src/main.c

Index: main.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/main.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- main.c	29 Jan 2004 01:02:06 -0000	1.38
+++ main.c	24 Feb 2004 21:02:44 -0000	1.39
@@ -76,12 +76,13 @@
 
 static void _print_usage()
 {
+    printf(ICECAST_VERSION_STRING "\n\n");
     printf("usage: icecast [-h -b -v] -c <file>\n");
     printf("options:\n");
-	printf("\t-c <file>\tSpecify configuration file\n");
-	printf("\t-h\t\tDisplay usage\n");
-	printf("\t-v\t\tDisplay version info\n");
-	printf("\t-b\t\tRun icecast in the background\n");
+    printf("\t-c <file>\tSpecify configuration file\n");
+    printf("\t-h\t\tDisplay usage\n");
+    printf("\t-v\t\tDisplay version info\n");
+    printf("\t-b\t\tRun icecast in the background\n");
     printf("\n");
 }
 
@@ -109,14 +110,14 @@
 
 static void _shutdown_subsystems(void)
 {
-#ifdef USE_YP
-    curl_shutdown();
-#endif
     fserve_shutdown();
     xslt_shutdown();
     refbuf_shutdown();
     slave_shutdown();
     stats_shutdown();
+#ifdef USE_YP
+    curl_shutdown();
+#endif
 
     /* Now that these are done, we can stop the loggers. */
     _stop_logging();
@@ -142,17 +143,18 @@
     while (i < argc) {
         if (strcmp(argv[i], "-b") == 0) {
 #ifndef WIN32
-                fprintf(stdout, "Starting icecast2\nDetaching from the console\n");
-                if ((processID = (int)fork()) > 0) {
-                        /* exit the parent */
-                        _exit(0);
-                }
+            fprintf(stdout, "Starting icecast2\nDetaching from the console\n");
+            if ((processID = (int)fork()) > 0) {
+                /* exit the parent */
+                _exit(0);
+            }
 #endif
         }
         if (strcmp(argv[i], "-v") == 0) {
             fprintf(stdout, "%s\n", ICECAST_VERSION_STRING);
-			exit(0);
-		}
+            exit(0);
+        }
+
         if (strcmp(argv[i], "-c") == 0) {
             if (i + 1 < argc) {
                 strncpy(filename, argv[i + 1], size-1);
@@ -452,7 +454,7 @@
         }
     }
 
-    INFO0("icecast server started");
+    INFO0 (ICECAST_VERSION_STRING " server started");
 
     /* REM 3D Graphics */
 
@@ -483,16 +485,3 @@
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list