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"
dnl Check for headers
AC_CHECK_HEADERS([search.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([net/if.h], [], [],
[
......
......@@ -29,10 +29,8 @@
# include "config.h"
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <limits.h>
#include <sys/stat.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
......
......@@ -35,10 +35,7 @@
#include <vlc_access.h>
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
# include <fcntl.h>
......
......@@ -34,9 +34,7 @@
# include <unistd.h>
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
......@@ -1452,20 +1450,17 @@ static int ProbeDVD( const char *psz_name )
#endif
int ret = VLC_EGENERIC;
#ifdef HAVE_SYS_STAT_H
struct stat stat_info;
if( fstat( fd, &stat_info ) == -1 )
goto bailout;
if( !S_ISREG( 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 */
goto bailout;
}
#endif
/* Match extension as the anchor exhibits too many false positives */
const char *ext = strrchr( psz_name, '.' );
if( ext == NULL )
......
......@@ -30,9 +30,7 @@
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_FSTATVFS
# include <sys/statvfs.h>
......@@ -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))
|| (p_access->info.i_pos > p_access->info.i_size))
{
#ifdef HAVE_SYS_STAT_H
struct stat st;
if ((fstat (fd, &st) == 0)
......@@ -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_update |= INPUT_UPDATE_SIZE;
}
#endif
}
return i_ret;
}
......
......@@ -33,9 +33,7 @@
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <poll.h>
......@@ -158,14 +156,10 @@ static int Open( vlc_object_t *p_this )
}
p_sys->fd = fd;
#ifdef HAVE_SYS_STAT_H
struct stat st;
if( fstat( fd, &st ) )
msg_Err( p_access, "fstat(%d): %m", fd );
p_access->info.i_size = st.st_size;
#else
# warning File size not known!
#endif
return VLC_SUCCESS;
}
......
......@@ -31,9 +31,7 @@
#include <errno.h>
#ifdef WIN32
# include <fcntl.h>
# ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
# endif
# include <io.h>
# define smbc_open(a,b,c) vlc_open(a,b,c)
# define smbc_fstat(a,b) _fstati64(a,b)
......
......@@ -38,9 +38,7 @@
# include <unistd.h>
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_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.
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
......
......@@ -41,9 +41,7 @@
#endif
#include <errno.h>
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#include <vlc_common.h>
#include <vlc_md5.h>
......
......@@ -38,9 +38,7 @@
#include <assert.h>
#include <wchar.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
......
......@@ -25,9 +25,7 @@
#include "../src/os_factory.hpp"
#include <vlc_url.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
XMLParser::XMLParser( intf_thread_t *pIntf, const string &rFileName )
: SkinObject( pIntf ), m_pXML( NULL ), m_pReader( NULL ), m_pStream( NULL )
......@@ -79,7 +77,6 @@ void XMLParser::LoadCatalog()
const string &sep = pOSFactory->getDirSeparator();
list<string>::const_iterator it;
#ifdef HAVE_SYS_STAT_H
struct stat statBuf;
// Try to load the catalog first (needed at least on win32 where
......@@ -119,7 +116,6 @@ void XMLParser::LoadCatalog()
{
msg_Err( getIntf(), "cannot find the skins DTD");
}
#endif
}
bool XMLParser::parse()
......
......@@ -27,9 +27,7 @@
#endif
#include <fcntl.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
......
......@@ -271,7 +271,6 @@ static int vlclua_fd_read( lua_State *L )
*****************************************************************************/
static int vlclua_stat( lua_State *L )
{
#ifdef HAVE_SYS_STAT_H
const char *psz_path = luaL_checkstring( L, 1 );
struct stat s;
if( vlc_stat( psz_path, &s ) )
......@@ -320,10 +319,6 @@ static int vlclua_stat( lua_State *L )
lua_pushinteger( L, s.st_ctime );
lua_setfield( L, -2, "creation_time" );
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 )
......
......@@ -31,9 +31,7 @@
#include <stdarg.h>
#include <assert.h>
#include <errno.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#include <vlc_common.h>
#include <vlc_sql.h>
......
......@@ -29,9 +29,7 @@
# include "config.h"
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
......
......@@ -31,9 +31,7 @@
#include <sys/types.h>
#include <errno.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#ifdef WIN32
# include <io.h>
# include <wincrypt.h>
......
......@@ -34,9 +34,7 @@
#if defined (WIN32) && !defined (UNDER_CE)
# include <direct.h>
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
......
......@@ -34,9 +34,7 @@
#include <limits.h>
#include <assert.h>
#include <errno.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#include "input_internal.h"
#include "event.h"
......
......@@ -34,9 +34,7 @@
#include <assert.h>
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
......
......@@ -27,9 +27,7 @@
#endif
#include <assert.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#include <vlc_common.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