From 7df1bf7122c18bb07cbe753eccda5eabf2552e0b Mon Sep 17 00:00:00 2001 From: Wolfgang Hommel Date: Sun, 30 Apr 2023 20:26:07 +0200 Subject: Fix #424 --- src/libfaketime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libfaketime.c b/src/libfaketime.c index 5fa8152..b83bae4 100644 --- a/src/libfaketime.c +++ b/src/libfaketime.c @@ -3184,7 +3184,7 @@ int fake_clock_gettime(clockid_t clk_id, struct timespec *tp) /* check whether we should spawn an external command */ if (spawned == 0) { /* exec external command once only */ - if (((tmp_ts.tv_sec == ft_spawn_secs) || (callcounter == ft_spawn_ncalls)) && (spawned == 0)) + if ((((ft_spawn_secs > -1) && (tmp_ts.tv_sec >= ft_spawn_secs)) || (callcounter == ft_spawn_ncalls)) && (spawned == 0)) { spawned = 1; (void) (system(ft_spawn_target) + 1); -- cgit v1.2.1