The cal command generates output that depends on time(). For reliable
regression tests we need to use still same time. It seems that LD_PRELOAD is
pretty simple way.
Signed-off-by: Karel Zak <kzak@redhat.com>
depcomp
install-sh
missing
+ltmain.sh
echo "or see http://www.gnu.org/software/autoheader"
DIE=1
}
-
+(libtool --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have libtool installed to generate util-linux build-system."
+ echo "Download the appropriate package for your distribution,"
+ echo "or see http://www.gnu.org/software/libtool"
+ DIE=1
+}
if test "$DIE" -eq 1; then
exit 1
fi
}
autopoint --force
+libtoolize --copy --force
aclocal -I m4
automake --add-missing
autoconf
*/
#undef HAVE_DCGETTEXT
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
AC_PROG_CC_STDC
AC_PROG_RANLIB
+AC_PROG_LIBTOOL
AC_PATH_PROG(PERL, perl)
include $(top_srcdir)/config/include-Makefile.am
noinst_PROGRAMS = mnt_test_sysinfo
+mnt_test_sysinfo_SOURCES = mnt_test_sysinfo.c
+
+
+noinst_LTLIBRARIES = libpreload-time.la
+
+libpreload_time_la_SOURCES = libpreload-time.c
+libpreload_time_la_LDFLAGS = -shared -rpath `pwd` -avoid-version
-mnt_test_sysinfo_SOURCES = mnt_test_sysinfo.c
--- /dev/null
+
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sys/time.h>
+
+time_t
+time(time_t *t)
+{
+ time_t tt = 0;
+ char *e = getenv("TEST_TIME");
+
+ if (e && isdigit((unsigned char) *e))
+ tt = atol(e);
+ else {
+ struct timeval tv;
+
+ if (gettimeofday(&tv, NULL) == 0)
+ tt = tv.tv_sec;
+ }
+ if (t)
+ *t = tt;
+
+ return tt;
+}