summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index cb4a47e..81879b5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -279,17 +279,18 @@ int main( int argc, char **argv )
}
CAP_SLEEP( remaining - ( ( remaining - 30 ) / 60 * 60 + 2 ) );
} else {
- CAP_SLEEP( remaining - 299 );
+ CAP_SLEEP( remaining - 305 );
}
}
}
do {
+ const time_t oldDeadline = nextAction.deadline;
// Handle requests
rpcHandle( listenFd );
// Might have set a new scheduled action
- if ( nextAction.deadline != 0 && nextAction.force ) {
+ if ( nextAction.deadline != oldDeadline ) {
int delta = nextAction.deadline - monoNOW;
- CAP_SLEEP( delta );
+ CAP_SLEEP( delta - 305 );
}
// Sleep until next run
//printf( "Sleeping %d seconds\n ", sleepTime );