summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure48
-rw-r--r--configure.ac4
-rw-r--r--src/htsglobal.h4
-rw-r--r--src/htslib.c19
-rw-r--r--src/proxy/proxytrack.h18
6 files changed, 6 insertions, 90 deletions
diff --git a/config.h.in b/config.h.in
index 98ea4fe..e124796 100644
--- a/config.h.in
+++ b/config.h.in
@@ -3,9 +3,6 @@
/* Check for dlopen in c */
#undef DLLIB
-/* Check for ftime */
-#undef FTIME
-
/* Define if pointers to integers require aligned access */
#undef HAVE_ALIGNED_ACCESS_REQUIRED
diff --git a/configure b/configure
index 61915a3..88113e3 100755
--- a/configure
+++ b/configure
@@ -14914,54 +14914,6 @@ fi
fi
-### Check for ftime
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftime in -lc" >&5
-$as_echo_n "checking for ftime in -lc... " >&6; }
-if ${ac_cv_lib_c_ftime+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ftime ();
-int
-main ()
-{
-return ftime ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_c_ftime=yes
-else
- ac_cv_lib_c_ftime=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_ftime" >&5
-$as_echo "$ac_cv_lib_c_ftime" >&6; }
-if test "x$ac_cv_lib_c_ftime" = xyes; then :
-
-
-$as_echo "#define FTIME 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-fi
-
-
### Check for setuid
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setuid in -lc" >&5
$as_echo_n "checking for setuid in -lc... " >&6; }
diff --git a/configure.ac b/configure.ac
index fbed15a..d6c1786 100644
--- a/configure.ac
+++ b/configure.ac
@@ -239,10 +239,6 @@ AC_DEFINE(DLLIB, 1,[Check for dlopen in c])], AC_MSG_WARN([*** not found * this
AC_SUBST(DL_LIBS)
fi
-### Check for ftime
-AC_CHECK_LIB(c, ftime, [
-AC_DEFINE(FTIME, 1,[Check for ftime])], AC_MSG_RESULT([not found]))
-
### Check for setuid
AC_CHECK_LIB(c, setuid, [
AC_DEFINE(SETUID, 1,[Check for setuid])], AC_MSG_RESULT([not found]))
diff --git a/src/htsglobal.h b/src/htsglobal.h
index 94a2c4a..2501520 100644
--- a/src/htsglobal.h
+++ b/src/htsglobal.h
@@ -93,10 +93,6 @@ Please visit our Website: http://www.httrack.com
#include "config.h"
-#ifndef FTIME
-#define HTS_DO_NOT_USE_FTIME
-#endif
-
#ifndef SETUID
#define HTS_DO_NOT_USE_UID
#endif
diff --git a/src/htslib.c b/src/htslib.c
index 1df4765..d19b3af 100644
--- a/src/htslib.c
+++ b/src/htslib.c
@@ -2602,7 +2602,6 @@ TStamp time_local(void) {
// number of millisec since 1970
HTSEXT_API TStamp mtime_local(void) {
-#ifndef HTS_DO_NOT_USE_FTIME
#ifndef _WIN32
struct timeval tv;
if (gettimeofday(&tv, NULL) != 0) {
@@ -2617,11 +2616,6 @@ HTSEXT_API TStamp mtime_local(void) {
return (TStamp) (((TStamp) B.time * (TStamp) 1000)
+ ((TStamp) B.millitm));
#endif
-#else
- // not precise..
- return (TStamp) (((TStamp) time_local() * (TStamp) 1000)
- + ((TStamp) 0));
-#endif
}
// convertit un nombre de secondes en temps (chaine)
@@ -2784,18 +2778,13 @@ struct tm *convert_time_rfc822(struct tm *result, const char *s) {
return NULL;
}
-static time_t getGMT(struct tm *tm) { /* hey, time_t is local! */
- time_t t = mktime(tm);
+static time_t getGMT(struct tm *tm) {
+ time_t t = timegm(tm);
if (t != (time_t) - 1 && t != (time_t) 0) {
- /* BSD does not have static "timezone" declared */
-#if (defined(BSD) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__))
- time_t now = time(NULL);
- time_t timezone = -localtime(&now)->tm_gmtoff;
-#endif
- return (time_t) (t - timezone);
+ return (time_t) t;
}
- return (time_t) - 1;
+ return (time_t) -1;
}
/* sets file time. -1 if error */
diff --git a/src/proxy/proxytrack.h b/src/proxy/proxytrack.h
index c8fc57d..e288e50 100644
--- a/src/proxy/proxytrack.h
+++ b/src/proxy/proxytrack.h
@@ -35,20 +35,16 @@ Please visit our Website: http://www.httrack.com
#include "store.h"
#include <sys/stat.h>
-#ifndef HTS_DO_NOT_USE_FTIME
#ifdef _WIN32
#include <sys/utime.h>
#else
#include <utime.h>
#endif
#include <sys/timeb.h>
-#else
-#include <utime.h>
-#endif
#ifndef _WIN32
#include <pthread.h>
#endif
-#include <stdarg.h>
+#include <stdarg.h>
/* generic */
@@ -378,17 +374,7 @@ HTS_UNUSED static struct tm PT_GetTime(time_t t) {
HTS_UNUSED static int set_filetime(const char *file, struct tm *tm_time) {
struct utimbuf tim;
-#ifndef HTS_DO_NOT_USE_FTIME
- struct timeb B;
-
- memset(&B, 0, sizeof(B));
- B.timezone = 0;
- ftime(&B);
- tim.actime = tim.modtime = mktime(tm_time) - B.timezone * 60;
-#else
- // bogus time (GMT/local)..
- tim.actime = tim.modtime = mktime(tm_time);
-#endif
+ tim.actime = tim.modtime = timegm(tm_time);
return utime(file, &tim);
}
HTS_UNUSED static int set_filetime_time_t(const char *file, time_t t) {