From: brarcher Date: Wed, 25 Dec 2013 03:05:06 +0000 (+0000) Subject: libcompat: remove fileno() replacement X-Git-Tag: 0.10.0~248 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9861c0594d4ecb91cfc75c1724a791a6f122eddb;p=check libcompat: remove fileno() replacement fileno() is no longer necessary, as pipe IO is now handled with FILE API. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@968 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e787f2..39961b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,7 +126,6 @@ ck_check_include_file("winioctl.h" HAVE_WINIOCTL_H) # Check functions check_function_exists(ctime_r HAVE_CTIME_R) check_function_exists(fcntl HAVE_FCNTL) -check_function_exists(fileno HAVE_DECL_FILENO) check_function_exists(fork HAVE_FORK) check_function_exists(fstat HAVE_FSTAT) check_function_exists(getenv HAVE_GETENV) @@ -174,7 +173,6 @@ check_function_exists(wctomb HAVE_WCTOMB) check_function_exists(wmemcmp HAVE_WMEMCMP) check_function_exists(wmemcpy HAVE_WMEMCPY) check_function_exists(_ctime64_s HAVE__CTIME64_S) -check_function_exists(_fileno HAVE__FILENO) check_function_exists(_fseeki64 HAVE__FSEEKI64) check_function_exists(_get_timezone HAVE__GET_TIMEZONE) check_function_exists(_getpid HAVE__GETPID) diff --git a/configure.ac b/configure.ac index 35a88bb..6043ddb 100644 --- a/configure.ac +++ b/configure.ac @@ -251,8 +251,8 @@ AC_FUNC_REALLOC # replaced with Check's replacement of these functions. HW_LIBRT_TIMERS -AC_REPLACE_FUNCS([alarm clock_gettime gettimeofday fileno localtime_r putenv setenv sleep strdup strsignal unsetenv]) -AC_CHECK_DECLS([alarm, clock_gettime, gettimeofday, fileno, localtime_r, putenv, setenv, sleep, strdup, strsignal, unsetenv]) +AC_REPLACE_FUNCS([alarm clock_gettime gettimeofday localtime_r putenv setenv sleep strdup strsignal unsetenv]) +AC_CHECK_DECLS([alarm, clock_gettime, gettimeofday, localtime_r, putenv, setenv, sleep, strdup, strsignal, unsetenv]) AC_CHECK_FUNCS([setitimer]) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 5082d80..04fe703 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -28,10 +28,6 @@ if (NOT HAVE_LIBRT) set(SOURCES ${SOURCES} timer_settime.c) endif(NOT HAVE_LIBRT) -if(NOT HAVE_DECL_FILENO AND NOT HAVE__FILENO) - set(SOURCES ${SOURCES} fileno.c) -endif(NOT HAVE_DECL_FILENO AND NOT HAVE__FILENO) - if(NOT HAVE_GETTIMEOFDAY) set(SOURCES ${SOURCES} gettimeofday.c) endif(NOT HAVE_GETTIMEOFDAY) diff --git a/lib/fileno.c b/lib/fileno.c deleted file mode 100644 index bb142de..0000000 --- a/lib/fileno.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "libcompat.h" - -int fileno(FILE *stream CK_ATTRIBUTE_UNUSED) -{ - assert (0); - return 0; -} diff --git a/lib/libcompat.h b/lib/libcompat.h index ee8a7a3..0b4b53e 100644 --- a/lib/libcompat.h +++ b/lib/libcompat.h @@ -83,13 +83,6 @@ void *rpl_malloc (size_t n); void *rpl_realloc (void *p, size_t n); #endif /* !HAVE_REALLOC */ -/* functions that may be undeclared */ -#if !HAVE_DECL_FILENO && !HAVE__FILENO -int fileno (FILE *stream); -#elif !HAVE_FILENO && HAVE__FILENO -#define fileno _fileno; -#endif /* !HAVE_DECL_FILENO && !HAVE__FILENO */ - #if !HAVE_GETPID && HAVE__GETPID #define getpid _getpid; #endif /* !HAVE_GETPID && HAVE__GETPID */