]> git.sesse.net Git - vlc/commitdiff
* configure.ac, modules/control/http.c: compilation fix for platforms without ctime_r().
authorGildas Bazin <gbazin@videolan.org>
Mon, 14 Jul 2003 16:10:20 +0000 (16:10 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 14 Jul 2003 16:10:20 +0000 (16:10 +0000)
configure.ac
modules/control/http.c

index 196b71058e3601d442883eae8644a634de2d8754..a15f98913d1417d807ed9ebd6c122b1ea8bb210f 100644 (file)
@@ -1,5 +1,5 @@
 dnl Autoconf settings for vlc
-dnl $Id: configure.ac,v 1.28 2003/07/11 11:58:12 gbazin Exp $
+dnl $Id: configure.ac,v 1.29 2003/07/14 16:10:20 gbazin Exp $
 
 AC_INIT(vlc,0.6.0)
 
@@ -244,7 +244,7 @@ CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcd
 dnl Check for system libs needed
 need_libc=false
 
-AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 if_nametoindex atoll getenv putenv setenv gmtime_r)
+AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r)
 
 dnl Check for usual libc functions
 AC_CHECK_FUNCS(strdup strndup atof lseek)
index 687660f4e84308864fe1c8f46243f684388731f1..86d7e345f934b1d75642d9add3d29b128c200363 100644 (file)
@@ -2,7 +2,7 @@
  * http.c :  http mini-server ;)
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: http.c,v 1.14 2003/07/12 00:56:18 fenrir Exp $
+ * $Id: http.c,v 1.15 2003/07/14 16:10:20 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -943,7 +943,7 @@ static mvar_t *mvar_FileSetNew( char *name, char *psz_dir )
 
     /* convert all / to native separator */
 #if defined( WIN32 )
-    while( p = strchr( psz_dir, '/' ) )
+    while( (p = strchr( psz_dir, '/' )) )
     {
         *p = '\\';
     }
@@ -1079,8 +1079,13 @@ static mvar_t *mvar_FileSetNew( char *name, char *psz_dir )
         mvar_AppendNewVar( f, "size", tmp );
 
         /* FIXME memory leak FIXME */
+#ifdef HAVE_CTIME_R
         ctime_r( &stat_info.st_mtime, tmp );
         mvar_AppendNewVar( f, "date", tmp );
+#else
+        mvar_AppendNewVar( f, "date", ctime( &stat_info.st_mtime ) );
+#endif
+
 #else
         mvar_AppendNewVar( f, "type", "unknown" );
         mvar_AppendNewVar( f, "size", "unknown" );