[xiph-commits] r10411 - icecast/trunk/icecast/src

karl at svn.xiph.org karl at svn.xiph.org
Sun Nov 20 05:53:32 PST 2005


Author: karl
Date: 2005-11-20 05:53:29 -0800 (Sun, 20 Nov 2005)
New Revision: 10411

Modified:
   icecast/trunk/icecast/src/source.c
Log:
allow for the intro file to change over HUP


Modified: icecast/trunk/icecast/src/source.c
===================================================================
--- icecast/trunk/icecast/src/source.c	2005-11-20 10:04:12 UTC (rev 10410)
+++ icecast/trunk/icecast/src/source.c	2005-11-20 13:53:29 UTC (rev 10411)
@@ -1091,19 +1091,27 @@
     else
         source->dumpfilename = NULL;
 
-    if (mountinfo && mountinfo->intro_filename && source->intro_file == NULL)
+    if (source->intro_file)
     {
+        fclose (source->intro_file);
+        source->intro_file = NULL;
+    }
+    if (mountinfo && mountinfo->intro_filename)
+    {
         ice_config_t *config = config_get_config_unlocked ();
         unsigned int len  = strlen (config->webroot_dir) +
             strlen (mountinfo->intro_filename) + 2;
         char *path = malloc (len);
         if (path)
         {
+            FILE *f;
             snprintf (path, len, "%s" PATH_SEPARATOR "%s", config->webroot_dir,
                     mountinfo->intro_filename);
 
-            source->intro_file = fopen (path, "rb");
-            if (source->intro_file == NULL)
+            f = fopen (path, "rb");
+            if (f)
+                source->intro_file = f;
+            else
                 WARN2 ("Cannot open intro file \"%s\": %s", path, strerror(errno));
             free (path);
         }



More information about the commits mailing list