Commit d46bb4f4 authored by Gildas Bazin's avatar Gildas Bazin

* configure.ac, modules/control/http.c: compilation fix for platforms without ctime_r().

parent 28c5e660
dnl Autoconf settings for vlc 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) AC_INIT(vlc,0.6.0)
...@@ -244,7 +244,7 @@ CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcd ...@@ -244,7 +244,7 @@ CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcd
dnl Check for system libs needed dnl Check for system libs needed
need_libc=false 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 dnl Check for usual libc functions
AC_CHECK_FUNCS(strdup strndup atof lseek) AC_CHECK_FUNCS(strdup strndup atof lseek)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* http.c : http mini-server ;) * http.c : http mini-server ;)
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * 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> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* Laurent Aimar <fenrir@via.ecp.fr> * Laurent Aimar <fenrir@via.ecp.fr>
...@@ -943,7 +943,7 @@ static mvar_t *mvar_FileSetNew( char *name, char *psz_dir ) ...@@ -943,7 +943,7 @@ static mvar_t *mvar_FileSetNew( char *name, char *psz_dir )
/* convert all / to native separator */ /* convert all / to native separator */
#if defined( WIN32 ) #if defined( WIN32 )
while( p = strchr( psz_dir, '/' ) ) while( (p = strchr( psz_dir, '/' )) )
{ {
*p = '\\'; *p = '\\';
} }
...@@ -1079,8 +1079,13 @@ static mvar_t *mvar_FileSetNew( char *name, char *psz_dir ) ...@@ -1079,8 +1079,13 @@ static mvar_t *mvar_FileSetNew( char *name, char *psz_dir )
mvar_AppendNewVar( f, "size", tmp ); mvar_AppendNewVar( f, "size", tmp );
/* FIXME memory leak FIXME */ /* FIXME memory leak FIXME */
#ifdef HAVE_CTIME_R
ctime_r( &stat_info.st_mtime, tmp ); ctime_r( &stat_info.st_mtime, tmp );
mvar_AppendNewVar( f, "date", tmp ); mvar_AppendNewVar( f, "date", tmp );
#else
mvar_AppendNewVar( f, "date", ctime( &stat_info.st_mtime ) );
#endif
#else #else
mvar_AppendNewVar( f, "type", "unknown" ); mvar_AppendNewVar( f, "type", "unknown" );
mvar_AppendNewVar( f, "size", "unknown" ); mvar_AppendNewVar( f, "size", "unknown" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment