Run of fresh-snapshots for faketime

Merge these changes:

git pull https://janitor.debian.net/git/faketime fresh-snapshots/main
git pull https://janitor.debian.net/git/faketime fresh-snapshots/pristine-tar

Summary

Merged new upstream version: 0.9.10+git20220416.1.f836ea3 (was: 0.9.10).

Diff

Branch: main

diff --git a/NEWS b/NEWS
index 2ed3d44..e6bbc0a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
 Since 0.9.9:
+    - automatically try to decide about FORCE_MONOTONIC_FIX
+      at run-time when not set as a compile-time flag
     - improved macOS Monterey support through dyld interposing
     - changed interception hooks for stat() and similar functions,
       refactored to use a common handler (@sirainen)
diff --git a/debian/changelog b/debian/changelog
index 884e466..30e27a3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+faketime (0.9.10+git20220416.1.f836ea3-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+  * Drop patch 0001-tests-avoid-testing-syscall-snippets-if-DINTERCEPT_S.patch,
+    present upstream.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Sun, 17 Apr 2022 01:53:45 -0000
+
 faketime (0.9.10-2) unstable; urgency=medium
 
   * drop unnecessary tweak to version number
diff --git a/debian/patches/0001-tests-avoid-testing-syscall-snippets-if-DINTERCEPT_S.patch b/debian/patches/0001-tests-avoid-testing-syscall-snippets-if-DINTERCEPT_S.patch
deleted file mode 100644
index 5dedcf7..0000000
--- a/debian/patches/0001-tests-avoid-testing-syscall-snippets-if-DINTERCEPT_S.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
-Date: Sat, 16 Apr 2022 10:06:23 -0700
-Subject: tests: avoid testing syscall snippets if -DINTERCEPT_SYSCALL is not
- set
-
-See https://bugs.debian.org/1007828
----
- test/Makefile | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/test/Makefile b/test/Makefile
-index 1b2a4aa..983d518 100644
---- a/test/Makefile
-+++ b/test/Makefile
-@@ -13,6 +13,9 @@ ALL_TESTS = timetest test
- 
- ifneq ($(filter -DINTERCEPT_SYSCALL,${CFLAGS}),)
- ALL_TESTS += confirm_variadic_promotion
-+else
-+TEST_SNIPPETS := $(filter-out syscall%,${TEST_SNIPPETS})
-+EXPECTATIONS := $(filter-out syscall%,${EXPECTATIONS})
- endif
- 
- all: $(ALL_TESTS)
diff --git a/debian/patches/series b/debian/patches/series
index 6dcea82..e69de29 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +0,0 @@
-0001-tests-avoid-testing-syscall-snippets-if-DINTERCEPT_S.patch
diff --git a/src/libfaketime.c b/src/libfaketime.c
index e632395..f92ecf8 100644
--- a/src/libfaketime.c
+++ b/src/libfaketime.c
@@ -830,6 +830,10 @@ static bool load_time(struct timespec *tp)
  *      Faked system functions: file related                     === FAKE(FILE)
  *      =======================================================================
  */
+#ifdef FAKE_UTIME
+static int fake_utime_disabled = 0;
+#endif
+
 
 #ifdef FAKE_STAT
 
@@ -843,7 +847,6 @@ static bool load_time(struct timespec *tp)
 #include <sys/stat.h>
 
 static int fake_stat_disabled = 0;
-static int fake_utime_disabled = 1;
 static bool user_per_tick_inc_set_backup = false;
 
 void lock_for_stat()
@@ -1564,7 +1567,7 @@ int ppoll(struct pollfd *fds, nfds_t nfds,
   }
   if (timeout_ts != NULL)
   {
-    if (user_rate_set && !dont_fake && (timeout_ts->tv_sec > 0))
+    if (user_rate_set && !dont_fake && ((timeout_ts->tv_sec > 0) || (timeout_ts->tv_nsec > 0)))
     {
       timespecmul(timeout_ts, 1.0 / user_rate, &real_timeout);
       real_timeout_pt = &real_timeout;
@@ -1722,6 +1725,21 @@ int select(int nfds, fd_set *readfds,
 #else
   DONT_FAKE_TIME(ret = (*real_select)(nfds, readfds, writefds, errorfds, timeout == NULL ? timeout : &timeout_real));
 #endif
+
+  /* scale timeout back if user rate is set, #382 */
+  if (user_rate_set && (timeout != NULL)) 
+  {
+    struct timespec ts;
+
+    ts.tv_sec = timeout_real.tv_sec;
+    ts.tv_nsec = timeout_real.tv_usec * 1000;
+
+    timespecmul(&ts, user_rate, &ts);
+
+    timeout->tv_sec = ts.tv_sec;
+    timeout->tv_usec = ts.tv_nsec / 1000;
+  } 
+
   return ret;
 }
 
@@ -2699,9 +2717,8 @@ static void ftpl_init(void)
   }
 #endif
 #if defined FAKE_FILE_TIMESTAMPS
-#ifndef FAKE_UTIME
-  fake_utime_disabled = 0; // Defaults to enabled w/o FAKE_UTIME define
-#endif
+#ifdef FAKE_UTIME
+  // fake_utime_disabled is 0 by default
   if ((tmp_env = getenv("FAKE_UTIME")) != NULL) //Note that this is NOT re-checked
   {
     if (!*tmp_env || *tmp_env == 'y' || *tmp_env == 'Y' || *tmp_env == 't' || *tmp_env == 'T')
@@ -2713,6 +2730,10 @@ static void ftpl_init(void)
       fake_utime_disabled = !atoi(tmp_env);
     }
   }
+#else
+  // compiled without FAKE_UTIME support, so don't allow it to be controlled by the env var
+  fake_utime_disabled = 1;
+#endif
 #endif
 
   if ((tmp_env = getenv("FAKETIME_CACHE_DURATION")) != NULL)
diff --git a/test/Makefile b/test/Makefile
index 1b2a4aa..afdc594 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -7,12 +7,15 @@ SRC = timetest.c
 OBJ = ${SRC:.c=.o}
 
 TEST_SNIPPETS = $(notdir $(basename $(wildcard snippets/*.c)))
-EXPECTATIONS= $(notdir $(basename $(wildcard snippets/*.variable)))
+EXPECTATIONS = $(notdir $(basename $(wildcard snippets/*.variable)))
 
 ALL_TESTS = timetest test
 
 ifneq ($(filter -DINTERCEPT_SYSCALL,${CFLAGS}),)
 ALL_TESTS += confirm_variadic_promotion
+else
+TEST_SNIPPETS := $(filter-out syscall%,${TEST_SNIPPETS})
+EXPECTATIONS := $(filter-out syscall%,${EXPECTATIONS})
 endif
 
 all: $(ALL_TESTS)
@@ -70,7 +73,7 @@ use_lib_%: _use_lib_test.c snippets/%.c lib%.so
 ## cleanup and metainformation
 
 clean:
-	@rm -f ${OBJ} timetest getrandom_test syscall_test $(foreach f,${TEST_SNIPPETS},use_lib_${f} lib${f}.so run_${f}) variadic_promotion variadic/*.o
+	@rm -f ${OBJ} timetest getrandom_test syscall_test $(foreach f,${TEST_SNIPPETS},use_lib_${f} lib${f}.so run_${f}) variadic_promotion variadic/*.o repeat_random
 
 distclean: clean
 	@echo

Branch: pristine-tar

diff --git a/faketime_0.9.10+git20220416.1.f836ea3.orig.tar.gz.delta b/faketime_0.9.10+git20220416.1.f836ea3.orig.tar.gz.delta
new file mode 100644
index 0000000..933c848
Binary files /dev/null and b/faketime_0.9.10+git20220416.1.f836ea3.orig.tar.gz.delta differ
diff --git a/faketime_0.9.10+git20220416.1.f836ea3.orig.tar.gz.id b/faketime_0.9.10+git20220416.1.f836ea3.orig.tar.gz.id
new file mode 100644
index 0000000..b15d160
--- /dev/null
+++ b/faketime_0.9.10+git20220416.1.f836ea3.orig.tar.gz.id
@@ -0,0 +1 @@
+4da13ec3b6dc477ae8ea7b86156f1a662fc73abb

Publish Blockers

  • ☑ run was successful
  • ☑ package has not been removed from the archive
  • ☑ command has not changed
  • ☒ not yet reviewed, but review needed
  • ☑ 0 publish attempts so far.not currently attempting to back off
  • ☒ merge proposals for the package maintainer are currently being rate-limited (open: 4, max open: 2)
  • ☑ change set 924735d1-e4a9-4ade-a65b-42f6b037aedf is ready

Resulting package

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots faketime-dbgsymapt install -t fresh-snapshots faketimeapt install -t fresh-snapshots libfaketime-dbgsymapt install -t fresh-snapshots libfaketime

Lintian Result

Full worker log Full build log