From e9b8b6cf1abcf8cf2ce5124965ea9deeb1b1ee08 Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 17 Jul 2007 09:40:32 +0000 Subject: Remove unused fseeko() check and fallback implementation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23797 b3059339-0415-0410-9bf9-f77b7e298cf2 --- osdep/Makefile | 1 - osdep/fseeko.c | 67 ---------------------------------------------------------- 2 files changed, 68 deletions(-) delete mode 100644 osdep/fseeko.c (limited to 'osdep') diff --git a/osdep/Makefile b/osdep/Makefile index 8c520c3e10..34e360e7a7 100644 --- a/osdep/Makefile +++ b/osdep/Makefile @@ -5,7 +5,6 @@ LIBNAME_COMMON = libosdep.a SRCS_COMMON-$(HAVE_SYS_MMAN_H) += mmap_anon.c SRCS_COMMON-$(MACOSX_FINDER_SUPPORT) += macosx_finder_args.c -SRCS_COMMON-$(NEED_FSEEKO) += fseeko.c SRCS_COMMON-$(NEED_FTELLO) += ftello.c SRCS_COMMON-$(NEED_GETTIMEOFDAY) += gettimeofday.c SRCS_COMMON-$(NEED_GLOB) += glob-win.c diff --git a/osdep/fseeko.c b/osdep/fseeko.c deleted file mode 100644 index 7d942a1c25..0000000000 --- a/osdep/fseeko.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * fseeko.c - * 64-bit versions of fseeko/ftello() for systems which do not have them - */ - -#include "config.h" - -#include -#include -#include -#include - -#ifdef WIN32 -#define flockfile -#define funlockfile -#endif - -/* - * On BSD/OS and NetBSD (and perhaps others), off_t and fpos_t are the - * same. Standards say off_t is an arithmetic type, but not necessarily - * integral, while fpos_t might be neither. - * - * This is thread-safe on BSD/OS using flockfile/funlockfile. - */ - -int -fseeko(FILE *stream, off_t offset, int whence) -{ - fpos_t floc; - struct stat filestat; - - switch (whence) - { - case SEEK_CUR: - flockfile(stream); - if (fgetpos(stream, &floc) != 0) - goto failure; - floc += offset; - if (fsetpos(stream, &floc) != 0) - goto failure; - funlockfile(stream); - return 0; - break; - case SEEK_SET: - if (fsetpos(stream, &offset) != 0) - return -1; - return 0; - break; - case SEEK_END: - flockfile(stream); - if (fstat(fileno(stream), &filestat) != 0) - goto failure; - floc = filestat.st_size; - if (fsetpos(stream, &floc) != 0) - goto failure; - funlockfile(stream); - return 0; - break; - default: - errno = EINVAL; - return -1; - } - -failure: - funlockfile(stream); - return -1; -} -- cgit v1.2.3