Commit 75d005cf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove inconsistently used check for <sys/stat.h>

parent d191a555
...@@ -666,7 +666,7 @@ fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ...@@ -666,7 +666,7 @@ fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
dnl Check for headers dnl Check for headers
AC_CHECK_HEADERS([search.h]) AC_CHECK_HEADERS([search.h])
AC_CHECK_HEADERS(getopt.h locale.h xlocale.h) AC_CHECK_HEADERS(getopt.h locale.h xlocale.h)
AC_CHECK_HEADERS([sys/time.h sys/ioctl.h sys/stat.h]) AC_CHECK_HEADERS([sys/time.h sys/ioctl.h])
AC_CHECK_HEADERS([arpa/inet.h netinet/udplite.h sys/eventfd.h]) AC_CHECK_HEADERS([arpa/inet.h netinet/udplite.h sys/eventfd.h])
AC_CHECK_HEADERS([net/if.h], [], [], AC_CHECK_HEADERS([net/if.h], [], [],
[ [
......
...@@ -29,10 +29,8 @@ ...@@ -29,10 +29,8 @@
# include "config.h" # include "config.h"
#endif #endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <limits.h> #include <limits.h>
#include <sys/stat.h>
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
......
...@@ -35,10 +35,7 @@ ...@@ -35,10 +35,7 @@
#include <vlc_access.h> #include <vlc_access.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
# include <fcntl.h> # include <fcntl.h>
......
...@@ -34,9 +34,7 @@ ...@@ -34,9 +34,7 @@
# include <unistd.h> # include <unistd.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
...@@ -1452,20 +1450,17 @@ static int ProbeDVD( const char *psz_name ) ...@@ -1452,20 +1450,17 @@ static int ProbeDVD( const char *psz_name )
#endif #endif
int ret = VLC_EGENERIC; int ret = VLC_EGENERIC;
#ifdef HAVE_SYS_STAT_H
struct stat stat_info; struct stat stat_info;
if( fstat( fd, &stat_info ) == -1 ) if( fstat( fd, &stat_info ) == -1 )
goto bailout; goto bailout;
if( !S_ISREG( stat_info.st_mode ) ) if( !S_ISREG( stat_info.st_mode ) )
{ {
if( S_ISDIR( stat_info.st_mode ) || S_ISBLK( stat_info.st_mode ) ) if( S_ISDIR( stat_info.st_mode ) || S_ISBLK( stat_info.st_mode ) )
ret = VLC_SUCCESS; /* Let dvdnav_open() do the probing */ ret = VLC_SUCCESS; /* Let dvdnav_open() do the probing */
goto bailout; goto bailout;
} }
#endif
/* Match extension as the anchor exhibits too many false positives */ /* Match extension as the anchor exhibits too many false positives */
const char *ext = strrchr( psz_name, '.' ); const char *ext = strrchr( psz_name, '.' );
if( ext == NULL ) if( ext == NULL )
......
...@@ -30,9 +30,7 @@ ...@@ -30,9 +30,7 @@
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_FSTATVFS #ifdef HAVE_FSTATVFS
# include <sys/statvfs.h> # include <sys/statvfs.h>
...@@ -313,7 +311,6 @@ ssize_t FileRead( access_t *p_access, uint8_t *p_buffer, size_t i_len ) ...@@ -313,7 +311,6 @@ ssize_t FileRead( access_t *p_access, uint8_t *p_buffer, size_t i_len )
if ((p_access->info.i_size && !(p_sys->i_nb_reads % INPUT_FSTAT_NB_READS)) if ((p_access->info.i_size && !(p_sys->i_nb_reads % INPUT_FSTAT_NB_READS))
|| (p_access->info.i_pos > p_access->info.i_size)) || (p_access->info.i_pos > p_access->info.i_size))
{ {
#ifdef HAVE_SYS_STAT_H
struct stat st; struct stat st;
if ((fstat (fd, &st) == 0) if ((fstat (fd, &st) == 0)
...@@ -322,7 +319,6 @@ ssize_t FileRead( access_t *p_access, uint8_t *p_buffer, size_t i_len ) ...@@ -322,7 +319,6 @@ ssize_t FileRead( access_t *p_access, uint8_t *p_buffer, size_t i_len )
p_access->info.i_size = st.st_size; p_access->info.i_size = st.st_size;
p_access->info.i_update |= INPUT_UPDATE_SIZE; p_access->info.i_update |= INPUT_UPDATE_SIZE;
} }
#endif
} }
return i_ret; return i_ret;
} }
......
...@@ -33,9 +33,7 @@ ...@@ -33,9 +33,7 @@
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <poll.h> #include <poll.h>
...@@ -158,14 +156,10 @@ static int Open( vlc_object_t *p_this ) ...@@ -158,14 +156,10 @@ static int Open( vlc_object_t *p_this )
} }
p_sys->fd = fd; p_sys->fd = fd;
#ifdef HAVE_SYS_STAT_H
struct stat st; struct stat st;
if( fstat( fd, &st ) ) if( fstat( fd, &st ) )
msg_Err( p_access, "fstat(%d): %m", fd ); msg_Err( p_access, "fstat(%d): %m", fd );
p_access->info.i_size = st.st_size; p_access->info.i_size = st.st_size;
#else
# warning File size not known!
#endif
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
#include <errno.h> #include <errno.h>
#ifdef WIN32 #ifdef WIN32
# include <fcntl.h> # include <fcntl.h>
# ifdef HAVE_SYS_STAT_H
# include <sys/stat.h> # include <sys/stat.h>
# endif
# include <io.h> # include <io.h>
# define smbc_open(a,b,c) vlc_open(a,b,c) # define smbc_open(a,b,c) vlc_open(a,b,c)
# define smbc_fstat(a,b) _fstati64(a,b) # define smbc_fstat(a,b) _fstati64(a,b)
......
...@@ -38,9 +38,7 @@ ...@@ -38,9 +38,7 @@
# include <unistd.h> # include <unistd.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h> # include <arpa/inet.h>
......
...@@ -46,9 +46,7 @@ See http://www.vdr-wiki.de/ and http://www.tvdr.de/ for more information. ...@@ -46,9 +46,7 @@ See http://www.vdr-wiki.de/ and http://www.tvdr.de/ for more information.
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
......
...@@ -41,9 +41,7 @@ ...@@ -41,9 +41,7 @@
#endif #endif
#include <errno.h> #include <errno.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_md5.h> #include <vlc_md5.h>
......
...@@ -38,9 +38,7 @@ ...@@ -38,9 +38,7 @@
#include <assert.h> #include <assert.h>
#include <wchar.h> #include <wchar.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
......
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
#include "../src/os_factory.hpp" #include "../src/os_factory.hpp"
#include <vlc_url.h> #include <vlc_url.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
XMLParser::XMLParser( intf_thread_t *pIntf, const string &rFileName ) XMLParser::XMLParser( intf_thread_t *pIntf, const string &rFileName )
: SkinObject( pIntf ), m_pXML( NULL ), m_pReader( NULL ), m_pStream( NULL ) : SkinObject( pIntf ), m_pXML( NULL ), m_pReader( NULL ), m_pStream( NULL )
...@@ -79,7 +77,6 @@ void XMLParser::LoadCatalog() ...@@ -79,7 +77,6 @@ void XMLParser::LoadCatalog()
const string &sep = pOSFactory->getDirSeparator(); const string &sep = pOSFactory->getDirSeparator();
list<string>::const_iterator it; list<string>::const_iterator it;
#ifdef HAVE_SYS_STAT_H
struct stat statBuf; struct stat statBuf;
// Try to load the catalog first (needed at least on win32 where // Try to load the catalog first (needed at least on win32 where
...@@ -119,7 +116,6 @@ void XMLParser::LoadCatalog() ...@@ -119,7 +116,6 @@ void XMLParser::LoadCatalog()
{ {
msg_Err( getIntf(), "cannot find the skins DTD"); msg_Err( getIntf(), "cannot find the skins DTD");
} }
#endif
} }
bool XMLParser::parse() bool XMLParser::parse()
......
...@@ -27,9 +27,7 @@ ...@@ -27,9 +27,7 @@
#endif #endif
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
......
...@@ -271,7 +271,6 @@ static int vlclua_fd_read( lua_State *L ) ...@@ -271,7 +271,6 @@ static int vlclua_fd_read( lua_State *L )
*****************************************************************************/ *****************************************************************************/
static int vlclua_stat( lua_State *L ) static int vlclua_stat( lua_State *L )
{ {
#ifdef HAVE_SYS_STAT_H
const char *psz_path = luaL_checkstring( L, 1 ); const char *psz_path = luaL_checkstring( L, 1 );
struct stat s; struct stat s;
if( vlc_stat( psz_path, &s ) ) if( vlc_stat( psz_path, &s ) )
...@@ -320,10 +319,6 @@ static int vlclua_stat( lua_State *L ) ...@@ -320,10 +319,6 @@ static int vlclua_stat( lua_State *L )
lua_pushinteger( L, s.st_ctime ); lua_pushinteger( L, s.st_ctime );
lua_setfield( L, -2, "creation_time" ); lua_setfield( L, -2, "creation_time" );
return 1; return 1;
#else
# warning "Woops, looks like we don't have stat on your platform"
return luaL_error( L, "System is missing <sys/stat.h>" );
#endif
} }
static int vlclua_opendir( lua_State *L ) static int vlclua_opendir( lua_State *L )
......
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_sql.h> #include <vlc_sql.h>
......
...@@ -29,9 +29,7 @@ ...@@ -29,9 +29,7 @@
# include "config.h" # include "config.h"
#endif #endif
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
......
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <errno.h> #include <errno.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#ifdef WIN32 #ifdef WIN32
# include <io.h> # include <io.h>
# include <wincrypt.h> # include <wincrypt.h>
......
...@@ -34,9 +34,7 @@ ...@@ -34,9 +34,7 @@
#if defined (WIN32) && !defined (UNDER_CE) #if defined (WIN32) && !defined (UNDER_CE)
# include <direct.h> # include <direct.h>
#endif #endif
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
......
...@@ -34,9 +34,7 @@ ...@@ -34,9 +34,7 @@
#include <limits.h> #include <limits.h>
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#include "input_internal.h" #include "input_internal.h"
#include "event.h" #include "event.h"
......
...@@ -34,9 +34,7 @@ ...@@ -34,9 +34,7 @@
#include <assert.h> #include <assert.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
......
...@@ -27,9 +27,7 @@ ...@@ -27,9 +27,7 @@
#endif #endif
#include <assert.h> #include <assert.h>
#ifdef HAVE_SYS_STAT_H #include <sys/stat.h>
# include <sys/stat.h>
#endif
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_playlist.h> #include <vlc_playlist.h>
......
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